{ pkgs, ... }: { programs.vscode = { enable = true; package = pkgs.vscodium; mutableExtensionsDir = false; profiles.default = { enableUpdateCheck = false; enableExtensionUpdateCheck = false; extensions = # if unfree # with pkgs.vscode-marketplace; with pkgs.open-vsx; [ vscodevim.vim jnoortheen.nix-ide github.github-vscode-theme rust-lang.rust-analyzer shd101wyy.markdown-preview-enhanced alefragnani.bookmarks tomrijndorp.find-it-faster streetsidesoftware.code-spell-checker emilast.logfilehighlighter ]; userSettings = let vimCommonKeyBindings = [ { "before" = [ "C-a" ]; "commands" = [ "cursorHome" ]; } { "before" = [ "C-e" ]; "commands" = [ "cursorEnd" ]; } ]; in { "workbench.colorTheme" = "GitHub Dark Default"; "workbench.startupEditor" = "none"; "workbench.enableExperiments" = false; "files.autoSave" = "onFocusChange"; "editor.fontFamily" = "IBM Plex Mono"; "editor.fontSize" = 15; "editor.minimap.enabled" = false; "window.zoomLevel" = 0.5; "security.promptForLocalFileProtocolHandling" = false; "security.promptForRemoteFileProtocolHandling" = false; "explorer.confirmDelete" = false; "explorer.confirmDragAndDrop" = false; "editor.acceptSuggestionOnEnter" = "off"; "editor.acceptSuggestionOnCommitCharacter" = false; "git.openRepositoryInParentFolders" = "never"; "git.ignoreLimitWarning" = true; "git.blame.editorDecoration.enabled" = true; "extensions.ignoreRecommendations" = true; "telemetry.enableTelemetry" = false; "telemetry.telemetryLevel" = "off"; "window.titleBarStyle" = "custom"; # terminal stuff "terminal.integrated.cursorBlinking" = true; "terminal.integrated.cursorStyle" = "line"; "terminal.integrated.customGlyphs" = false; "terminal.integrated.env.linux" = { # https://github.com/tomrijndorp/vscode-finditfaster/issues/112#issuecomment-2475227546 FZF_DEFAULT_OPTS = "--bind ctrl-n:down,ctrl-p:up"; }; # don't let the workbench handle terminal keys like ctrl+n and friends "terminal.integrated.sendKeybindingsToShell" = true; "terminal.integrated.allowChords" = false; "markdown-preview-enhanced.previewTheme" = "github-dark.css"; "nix.enableLanguageServer" = true; "nix.serverPath" = "nil"; "bookmarks.saveBookmarksInProject" = true; "cSpell.enabledFileTypes" = { "markdown" = true; "*" = false; }; # vim stuff "vim.leader" = ","; "vim.normalModeKeyBindings" = vimCommonKeyBindings ++ [ { "before" = [ ";" ]; "after" = [ ":" ]; "silent" = true; } { "before" = [ "" "m" ]; "commands" = [ "bookmarks.toggle" ]; } { "before" = [ "" "l" ]; "commands" = [ "bookmarks.toggleLabeled" ]; } { "before" = [ "" "b" ]; "commands" = [ "bookmarks.list" ]; } { "before" = [ "" "s" ]; "commands" = [ "workbench.action.toggleSidebarVisibility" ]; } { "before" = [ "" "f" "f" ]; "commands" = [ "find-it-faster.findFiles" ]; } { "before" = [ "" "f" "g" ]; "commands" = [ "find-it-faster.findWithinFiles" ]; } { "before" = [ "" "f" "t" ]; "commands" = [ "find-it-faster.findWithinFilesWithType" ]; } # "gd" for definitions is by default { "before" = [ "g" "r" ]; "commands" = [ "editor.action.goToReferences" ]; } # the default is weird when you need to go back within a file { "before" = [ "C-o" ]; "commands" = [ "workbench.action.navigateBack" ]; } { "before" = [ "C-i" ]; "commands" = [ "workbench.action.navigateForward" ]; } # insert line without leaving normal mode { "before" = [ "" "o" ]; "commands" = [ "editor.action.insertLineAfter" ]; } { "before" = [ "" "O" ]; "commands" = [ "editor.action.insertLineBefore" ]; } ]; "vim.insertModeKeyBindings" = vimCommonKeyBindings ++ [ { "before" = [ "C-k" ]; "commands" = [ "acceptSelectedSuggestion" ]; } ]; "vim.visualModeKeyBindings" = vimCommonKeyBindings ++ [ { "before" = [ ">" ]; "commands" = [ "editor.action.indentLines" ]; } { "before" = [ "<" ]; "commands" = [ "editor.action.outdentLines" ]; } ]; "extensions.experimental.affinity" = { "vscodevim.vim" = 1; }; }; }; }; }