feat(vscode): add more nix extensions, keybindings

This commit is contained in:
winston 2023-06-20 20:09:18 +02:00
parent 6c80ca1501
commit 1012e0cfdf
Signed by: winston
GPG key ID: 3786770EDBC2B481
3 changed files with 70 additions and 10 deletions

View file

@ -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";
}

View file

@ -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"
}
]

View file

@ -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,