diff options
| author | Mel <einebeere@gmail.com> | 2025-01-14 22:13:14 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2025-01-14 22:28:39 +0100 |
| commit | e703f3a7ffee32fc2c7bd7cf1129846d3411fe56 (patch) | |
| tree | a814d85c629fc6dc0129e6e6053656cd764f9f83 /configs/vscode | |
| parent | 668601ce9736a8de37f83dcd0e0fe755310f2268 (diff) | |
| download | minerals-e703f3a7ffee32fc2c7bd7cf1129846d3411fe56.tar.zst minerals-e703f3a7ffee32fc2c7bd7cf1129846d3411fe56.zip | |
Fully configure VSCode
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'configs/vscode')
| -rw-r--r-- | configs/vscode/keybindings.nix | 42 | ||||
| -rw-r--r-- | configs/vscode/settings.nix | 109 |
2 files changed, 151 insertions, 0 deletions
diff --git a/configs/vscode/keybindings.nix b/configs/vscode/keybindings.nix new file mode 100644 index 0000000..fcb6e4d --- /dev/null +++ b/configs/vscode/keybindings.nix @@ -0,0 +1,42 @@ +{ ... }: + +[ + # toggle the left panels nicely. + { + key = "ctrl+b"; + command = "workbench.action.toggleSidebarVisibility"; + } + { + key = "alt+b"; + command = "workbench.action.toggleActivityBarVisibility"; + } + # quickly switch left panel view by order. + { + key = "ctrl+alt+1"; + command = "workbench.view.explorer"; + } + { + key = "ctrl+alt+2"; + command = "workbench.view.search"; + } + { + key = "ctrl+alt+3"; + command = "workbench.view.scm"; + } + { + key = "ctrl+alt+4"; + command = "workbench.view.debug"; + } + { + key = "ctrl+alt+5"; + command = "workbench.view.extension.test"; + } + { + key = "ctrl+alt+6"; + command = "workbench.view.extensions"; + } + { + key = "ctrl+alt+7"; + command = "workbench.view.extension.bookmarks"; + } +] diff --git a/configs/vscode/settings.nix b/configs/vscode/settings.nix new file mode 100644 index 0000000..4e2fba1 --- /dev/null +++ b/configs/vscode/settings.nix @@ -0,0 +1,109 @@ +{ pkgs, lib, ... }: + +let + inherit (lib) getExe; + + # https://github.com/Sertion/vscode-gitblame?tab=readme-ov-file#message-tokens + blameMessageFormat = "\${author.name}; \${time.ago} * \${commit.summary}"; +in +{ + # appearance + "workbench.iconTheme" = "catppuccin-mocha"; + "workbench.colorTheme" = "Catppuccin Mocha"; + "workbench.productIconTheme" = "fluent-icons"; + "workbench.layoutControl.enabled" = false; + "workbench.activityBar.location" = "hidden"; + "window.menuBarVisibility" = "toggle"; + "window.commandCenter" = false; + "window.dialogStyle" = "custom"; + "window.titleBarStyle" = "custom"; + "window.title" = " "; + "vscode-pets.position" = "explorer"; + "vscode-pets.petSize" = "medium"; + + # editor appearance and behavior + "editor.fontSize" = 16; + "editor.fontFamily" = "Berkeley Mono"; + "editor.cursorStyle" = "block"; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.cursorBlinking" = "smooth"; + "editor.cursorSmoothCaretAnimation" = "on"; + "editor.minimap.autohide" = true; + "files.autoSave" = "afterDelay"; + + # git configuration + "git.autofetch" = "all"; + "git.enableCommitSigning" = true; + "github.gitProtocol" = "ssh"; + + "gitblame.inlineMessageEnabled" = true; + "gitblame.ignoreWhitespace" = true; + "gitblame.inlineMessageNoCommit" = ""; + "gitblame.inlineMessageFormat" = blameMessageFormat; + "gitblame.statusBarMessageFormat" = blameMessageFormat; + "gitblame.delayBlame" = 1000; + + # language configuration + "nix.enableLanguageServer" = true; + "nix.serverPath" = getExe pkgs.nil; + "nix.formatterPath" = getExe pkgs.nixfmt-rfc-style; + + "mesonbuild.buildFolder" = "build"; + "mesonbuild.formatting.enabled" = true; + "mesonbuild.linter.muon.enabled" = true; + "mesonbuild.downloadLanguageServer" = false; + "mesonbuild.languageServerPath" = getExe pkgs.mesonlsp; + "mesonbuild.mesonPath" = getExe pkgs.meson; + "mesonbuild.muomPath" = getExe pkgs.muon; + + "rust-analyzer.server.path" = getExe pkgs.rust-analyzer; + + "go.formatFlags" = [ "-s" ]; + "go.alternateTools" = with pkgs; { + go = getExe go; + gopls = getExe gopls; + dlv = getExe delve; + }; + + # vscode+vim configuration + "vim.useSystemClipboard" = true; + "vim.easymotion" = true; + "vim.hlsearch" = true; + "vim.gdefault" = true; + "vim.sneak" = true; + "vim.sneakReplacesF" = true; + "vim.vimrc.enable" = true; + "vim.vimrc.path" = ./../.vimrc; + "extensions.experimental.affinity" = { + "vscodevim.vim" = 1; + }; + "vim.useCtrlKeys" = true; + "vim.handleKeys" = { + "<C-p>" = false; # command palette + "<C-n>" = false; # new file + "<C-b>" = false; # toggle sidebar + "<C-k>" = false; # key with a million uses + "<C-a>" = false; # select all text + }; + "vim.normalModeKeyBindings" = [ + # add binds to manage bookmarks (from the bookmarks extension) + { + before = [ + "<leader>" + "m" + ]; + commands = [ "bookmarks.toggle" ]; + } + { + before = [ + "<leader>" + "b" + ]; + commands = [ "bookmarks.list" ]; + } + ]; + + # some other extension behavior + "direnv.restart.automatic" = true; +} |
