diff --git a/home/apps/vscode.nix b/home/apps/vscode.nix index abe8629..ffcbac1 100644 --- a/home/apps/vscode.nix +++ b/home/apps/vscode.nix @@ -1,36 +1,49 @@ { config, flakePath, + lib, pkgs, ... }: let inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux; + + settingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/settings.json"; + keybindingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/keybindings.json"; in { programs.vscode = { enable = true; package = pkgs.vscode; extensions = with pkgs.vscode-extensions.vscode-marketplace; [ + adrianwilczynski.alpine-js-intellisense + bradlc.vscode-tailwindcss + catppuccin.catppuccin-vsc-icons + denoland.vscode-deno + eamodio.gitlens + esbenp.prettier-vscode + github.vscode-pull-request-github + gitlab.gitlab-workflow jnoortheen.nix-ide + lunuan.kubernetes-templates mkhl.direnv ms-kubernetes-tools.vscode-kubernetes-tools pkief.material-icon-theme redhat.vscode-yaml rust-lang.rust-analyzer + sumneko.lua tamasfe.even-better-toml valentjn.vscode-ltex vscodevim.vim ]; mutableExtensionsDir = true; }; - home.file = { - "${config.xdg.configHome}/Code/User/settings.json" = { - enable = isLinux; - source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/settings.json"; - }; - "Library/Application Support/Code/User/settings.json" = { - enable = isDarwin; - source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/settings.json"; - }; + + home.file = lib.mkIf isDarwin { + "Library/Application Support/Code/User/keybindings.json".source = keybindingsJSON; + "Library/Application Support/Code/User/settings.json".source = settingsJSON; + }; + xdg.configFile = lib.mkIf isLinux { + "Code/User/keybindings.json".source = keybindingsJSON; + "Code/User/settings.json".source = settingsJSON; }; xdg.mimeApps.defaultApplications."text/plain" = "code.desktop"; } diff --git a/home/apps/vscode/keybindings.json b/home/apps/vscode/keybindings.json new file mode 100644 index 0000000..2b02daa --- /dev/null +++ b/home/apps/vscode/keybindings.json @@ -0,0 +1,47 @@ +[ + { + "key": "alt+x", + "command": "workbench.action.closeActiveEditor", + "when": "editorFocus" + }, + { + "key": "alt+,", + "command": "workbench.action.previousEditor", + "when": "editorFocus" + }, + { + "key": "alt+.", + "command": "workbench.action.nextEditor", + "when": "editorFocus" + }, + { + "key": "shift+cmd+]", + "command": "-workbench.action.nextEditor", + "when": "editorFocus" + }, + { + "key": "shift+cmd+[", + "command": "-workbench.action.previousEditor", + "when": "editorFocus" + }, + { + "key": "ctrl+t", + "command": "terminal.focus", + "when": "editorTextFocus" + }, + { + "key": "ctrl+t", + "command": "workbench.action.focusLastEditorGroup", + "when": "terminalFocus" + }, + { + "key": "ctrl+n", + "command": "workbench.files.action.focusFilesExplorer", + "when": "editorTextFocus" + }, + { + "key": "ctrl+n", + "command": "workbench.action.focusLastEditorGroup", + "when": "filesExplorerFocus" + } +] diff --git a/home/apps/vscode/settings.json b/home/apps/vscode/settings.json index 8b71983..e64ccc8 100644 --- a/home/apps/vscode/settings.json +++ b/home/apps/vscode/settings.json @@ -17,7 +17,7 @@ "editor.inlineSuggest.enabled": true, "editor.lineNumbers": "relative", "editor.minimap.enabled": false, - "extensions.autoUpdate": "onlyEnabledExtensions", + "extensions.autoUpdate": false, "extensions.ignoreRecommendations": true, "git.autofetch": true, "ltex.additionalRules.enablePickyRules": true,