mirror of
https://github.com/Xevion/dotfiles.git
synced 2026-01-31 02:24:11 -06:00
config: add IntelliJ keymap management and enable EXA for OpenCode
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
<keymap version="1" name="Primary" parent="VSCode">
|
||||||
|
<action id="Back">
|
||||||
|
<mouse-shortcut keystroke="button4" />
|
||||||
|
</action>
|
||||||
|
<action id="FileChooser.NewFile" />
|
||||||
|
<action id="Forward">
|
||||||
|
<mouse-shortcut keystroke="button5" />
|
||||||
|
</action>
|
||||||
|
<action id="NextOccurence">
|
||||||
|
<keyboard-shortcut first-keystroke="shift ctrl n" />
|
||||||
|
<keyboard-shortcut first-keystroke="ctrl n" />
|
||||||
|
</action>
|
||||||
|
<action id="NextTab">
|
||||||
|
<keyboard-shortcut first-keystroke="ctrl page_down" />
|
||||||
|
<keyboard-shortcut first-keystroke="alt right" />
|
||||||
|
</action>
|
||||||
|
<action id="PreviousTab">
|
||||||
|
<keyboard-shortcut first-keystroke="ctrl page_up" />
|
||||||
|
<keyboard-shortcut first-keystroke="alt left" />
|
||||||
|
</action>
|
||||||
|
</keymap>
|
||||||
@@ -97,6 +97,9 @@ fi
|
|||||||
# colored GCC warnings and errors
|
# colored GCC warnings and errors
|
||||||
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||||
|
|
||||||
|
# Enable EXA for OpenCode
|
||||||
|
export OPENCODE_ENABLE_EXA=true
|
||||||
|
|
||||||
# enable programmable completion features (you don't need to enable
|
# enable programmable completion features (you don't need to enable
|
||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||||
# sources /etc/bash.bashrc).
|
# sources /etc/bash.bashrc).
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ if status is-login
|
|||||||
end
|
end
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
# Enable EXA for OpenCode
|
||||||
|
set -gx OPENCODE_ENABLE_EXA true
|
||||||
|
|
||||||
# Common shared configuration (environment variables, PATH, tool setup)
|
# Common shared configuration (environment variables, PATH, tool setup)
|
||||||
{{ template "scripts/commonrc.fish.tmpl" dict "data" . }}
|
{{ template "scripts/commonrc.fish.tmpl" dict "data" . }}
|
||||||
|
|
||||||
|
|||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
{{ if eq .chezmoi.os "linux" -}}
|
||||||
|
#!/usr/bin/env bun
|
||||||
|
// Hash: {{ include ".managed/intellij/keymaps/Primary.xml" | sha256sum }}
|
||||||
|
|
||||||
|
import { readdirSync, existsSync, mkdirSync, lstatSync, readlinkSync, unlinkSync, symlinkSync } from "node:fs";
|
||||||
|
import { join } from "node:path";
|
||||||
|
|
||||||
|
const JETBRAINS_DIR = join(process.env.HOME!, ".config/JetBrains");
|
||||||
|
const SOURCE = "{{ .chezmoi.sourceDir }}/.managed/intellij/keymaps/Primary.xml";
|
||||||
|
const IDE_PATTERNS = [/^IntelliJIdea/, /^IdeaIC/];
|
||||||
|
|
||||||
|
const log = (msg: string) => console.log(`[intellij-keymaps] ${msg}`);
|
||||||
|
|
||||||
|
if (!existsSync(JETBRAINS_DIR)) {
|
||||||
|
log("No JetBrains directory found");
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const entry of readdirSync(JETBRAINS_DIR)) {
|
||||||
|
if (!IDE_PATTERNS.some((p) => p.test(entry))) continue;
|
||||||
|
|
||||||
|
const keymapsDir = join(JETBRAINS_DIR, entry, "keymaps");
|
||||||
|
const target = join(keymapsDir, "Primary.xml");
|
||||||
|
|
||||||
|
mkdirSync(keymapsDir, { recursive: true });
|
||||||
|
|
||||||
|
// Check if already correctly symlinked
|
||||||
|
if (existsSync(target)) {
|
||||||
|
try {
|
||||||
|
if (lstatSync(target).isSymbolicLink() && readlinkSync(target) === SOURCE) {
|
||||||
|
log(`${entry}: already linked`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} catch {}
|
||||||
|
unlinkSync(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
symlinkSync(SOURCE, target);
|
||||||
|
log(`${entry}: linked`);
|
||||||
|
}
|
||||||
|
{{ end -}}
|
||||||
Reference in New Issue
Block a user