2022-06-02 16:35:34 +02:00
|
|
|
{ pkgs, lib, config, ... }:
|
2024-01-23 08:51:55 +01:00
|
|
|
let
|
|
|
|
cfg = config.programs.vscode;
|
2022-03-07 16:01:52 +01:00
|
|
|
|
2024-01-23 08:51:55 +01:00
|
|
|
mapPrefixToSet = prefix: set:
|
2022-03-07 16:01:52 +01:00
|
|
|
with lib; attrsets.mapAttrs' (k: v: attrsets.nameValuePair ("${prefix}.${k}") v) set;
|
|
|
|
|
2024-01-23 08:51:55 +01:00
|
|
|
configDir = {
|
|
|
|
"vscode" = "Code";
|
|
|
|
"vscode-insiders" = "Code - Insiders";
|
|
|
|
"vscodium" = "VSCodium";
|
|
|
|
}.${cfg.package.pname};
|
|
|
|
userDir = "${config.xdg.configHome}/${configDir}/User";
|
|
|
|
configFilePath = "${userDir}/settings.json";
|
2022-03-07 16:01:52 +01:00
|
|
|
in
|
|
|
|
{
|
2024-01-23 08:51:55 +01:00
|
|
|
home.file.${configFilePath} = {
|
|
|
|
target = "${configFilePath}.ro";
|
|
|
|
onChange = ''install -m660 $(realpath "${configFilePath}.ro") "${configFilePath}"'';
|
|
|
|
};
|
|
|
|
|
2022-03-07 16:01:52 +01:00
|
|
|
programs.vscode ={
|
|
|
|
enable = true;
|
|
|
|
|
2022-11-19 16:15:19 +01:00
|
|
|
package = pkgs.vscode;
|
2022-03-07 16:01:52 +01:00
|
|
|
|
|
|
|
userSettings = let
|
|
|
|
editor = mapPrefixToSet "editor" {
|
|
|
|
fontFamily = "Fira Code";
|
|
|
|
fontLigatures = true;
|
2022-06-21 01:52:34 +02:00
|
|
|
lineNumbers = "relative";
|
2022-03-07 16:01:52 +01:00
|
|
|
mouseWheelZoom = false;
|
|
|
|
fontSize = 14;
|
|
|
|
"minimap.enabled" = false;
|
|
|
|
tabSize = 2;
|
|
|
|
insertSpaces = true;
|
2024-01-23 08:51:55 +01:00
|
|
|
"inlineSuggest.enabled" = true;
|
|
|
|
"inlayHints.enabled" = "offUnlessPressed";
|
2022-03-07 16:01:52 +01:00
|
|
|
detectIndentation = false;
|
|
|
|
tabCompletion = "onlySnippets";
|
|
|
|
snippetSuggestions = "top";
|
|
|
|
cursorBlinking = "smooth";
|
2024-01-23 08:51:55 +01:00
|
|
|
cursorSmoothCaretAnimation = "on";
|
2022-03-07 16:01:52 +01:00
|
|
|
multiCursorModifier = "ctrlCmd";
|
|
|
|
suggestSelection = "first";
|
|
|
|
cursorStyle = "line";
|
|
|
|
wordSeparators = "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-";
|
|
|
|
wordWrap = "off";
|
|
|
|
# "bracketPairColorization.enabled" = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
zen = mapPrefixToSet "zenMode" {
|
|
|
|
centerLayout = true;
|
|
|
|
hideStatusBar = false;
|
|
|
|
hideLineNumbers = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
vim = mapPrefixToSet "vim" {
|
|
|
|
useSystemClipboard = true;
|
|
|
|
"statusBarColorControl" = true;
|
|
|
|
"statusBarColors.insert" = "#20ff00";
|
|
|
|
"statusBarColors.normal" = "#1D1E20";
|
|
|
|
"statusBarColors.visual" = "#00ffff";
|
|
|
|
"statusBarColors.replace" = "#ff002b";
|
|
|
|
handleKeys = {
|
|
|
|
"<C-d>" = true;
|
|
|
|
"<C-j>" = false;
|
|
|
|
"<C-b>" = false;
|
|
|
|
"<C-k>" = false;
|
|
|
|
"<C-w>" = false;
|
|
|
|
"<C-n>" = false;
|
|
|
|
"<A-o>" = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
workbench = mapPrefixToSet "workbench" {
|
|
|
|
"settings.enableNaturalLanguageSearch" = false;
|
|
|
|
enableExperiments = false;
|
|
|
|
iconTheme = "material-icon-theme";
|
|
|
|
colorTheme = "Monokai ST3";
|
|
|
|
colorCustomizations = {
|
|
|
|
"statusBar.background" = "#1D1E20";
|
|
|
|
"statusBar.noFolderBackground" = "#1D1E20";
|
|
|
|
"statusBar.debuggingBackground" = "#1D1E20";
|
|
|
|
"[Monokai ST3]" = {
|
|
|
|
"editor.foreground" = "#ffffff";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
editorAssociations = {
|
|
|
|
"*.pdf" = "default";
|
|
|
|
"*.ipynb" = "jupyter.notebook.ipynb";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
python = mapPrefixToSet "python" {
|
|
|
|
"analysis.completeFunctionParens" = true;
|
|
|
|
"formatting.provider" = "yapf";
|
|
|
|
"formatting.yapfArgs" = [
|
|
|
|
"--style={based_on_style: pep8, indent_width: 2}"
|
|
|
|
];
|
|
|
|
"autoComplete.addBrackets" = true;
|
|
|
|
languageServer = "Pylance";
|
|
|
|
};
|
|
|
|
|
|
|
|
svg = mapPrefixToSet "svgviewer" {
|
|
|
|
transparencygrid = true;
|
|
|
|
enableautopreview = true;
|
|
|
|
previewcolumn = "Beside";
|
|
|
|
showzoominout = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
indentRainbow = mapPrefixToSet "indentRainbow" {
|
2022-06-02 16:35:34 +02:00
|
|
|
errorColor= "rgb(255, 0, 0)";
|
2022-03-07 16:01:52 +01:00
|
|
|
colors = [ # http://colrd.com/palette/38436/
|
|
|
|
"rgba(26, 19, 52, 0.1)"
|
|
|
|
"rgba(1, 84, 90, 0.1)"
|
|
|
|
"rgba(3, 195, 131, 0.1)"
|
|
|
|
"rgba(251, 191, 69, 0.1)"
|
|
|
|
"rgba(237, 3, 69, 0.1)"
|
|
|
|
"rgba(113, 1, 98, 0.1)"
|
|
|
|
"rgba(2, 44, 125, 0.1)"
|
|
|
|
"rgba(38, 41, 74, 0.1)"
|
|
|
|
"rgba(1, 115, 81, 0.1)"
|
|
|
|
"rgba(170, 217, 98, 0.1)"
|
|
|
|
"rgba(239, 106, 50, 0.1)"
|
|
|
|
"rgba(161, 42, 94, 0.1)"
|
|
|
|
];
|
|
|
|
ignoreErrorLanguages = [
|
|
|
|
"markdown"
|
|
|
|
"haskell"
|
|
|
|
"elm"
|
|
|
|
"fsharp"
|
|
|
|
"java"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
editor //
|
|
|
|
indentRainbow //
|
|
|
|
python //
|
|
|
|
svg //
|
|
|
|
workbench //
|
|
|
|
vim // # This needs to come after workbench because of setting ordering
|
|
|
|
zen //
|
|
|
|
{
|
|
|
|
"extensions.autoCheckUpdates" = false;
|
|
|
|
"extensions.autoUpdate" = false;
|
|
|
|
"diffEditor.ignoreTrimWhitespace" = false;
|
2024-01-23 08:51:55 +01:00
|
|
|
"diffEditor.hideUnchangedRegions" = "enabled";
|
2022-03-07 16:01:52 +01:00
|
|
|
"emmet.triggerExpansionOnTab" = true;
|
|
|
|
"explorer.confirmDragAndDrop" = false;
|
|
|
|
"git.allowForcePush" = true;
|
|
|
|
"git.autofetch" = true;
|
|
|
|
"telemetry.telemetryLevel" = "off";
|
|
|
|
"terminal.integrated.fontSize" = 14;
|
|
|
|
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
|
2024-01-23 08:51:55 +01:00
|
|
|
"window.zoomLevel" = 1;
|
2022-03-07 16:01:52 +01:00
|
|
|
|
|
|
|
# This setting does not support language overrides
|
|
|
|
"files.exclude" = {
|
|
|
|
# Java
|
|
|
|
"**/.classpath" = true;
|
|
|
|
"**/.project" = true;
|
|
|
|
"**/.settings" = true;
|
|
|
|
"**/.factorypath" = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Extensions
|
|
|
|
|
|
|
|
"bracket-pair-colorizer-2.colorMode" = "Consecutive";
|
|
|
|
"bracket-pair-colorizer-2.forceIterationColorCycle" = true;
|
|
|
|
"bracket-pair-colorizer-2.colors" = [
|
|
|
|
"#fff200"
|
|
|
|
"#3d33ff"
|
|
|
|
"#ff57d5"
|
|
|
|
"#00ff11"
|
|
|
|
"#ff8400"
|
|
|
|
"#ff0030"
|
|
|
|
];
|
|
|
|
|
2022-06-02 16:35:34 +02:00
|
|
|
"errorLens.errorBackground" = "rgba(240,0,0,0.1)";
|
|
|
|
"errorLens.warningBackground" = "rgba(180,180,0,0.1)";
|
2022-03-07 16:01:52 +01:00
|
|
|
|
|
|
|
"keyboard-quickfix.showActionNotification" = false;
|
|
|
|
|
|
|
|
"liveshare.presence" = true;
|
|
|
|
"liveshare.showInStatusBar" = "whileCollaborating";
|
|
|
|
|
|
|
|
"liveServer.settings.port" = 5500;
|
|
|
|
|
|
|
|
"material-icon-theme.folders.associations" = {
|
|
|
|
ui = "layout";
|
|
|
|
bloc = "controller";
|
|
|
|
};
|
|
|
|
|
|
|
|
"redhat.telemetry.enabled" = false;
|
|
|
|
|
|
|
|
"[html]" = {
|
|
|
|
"editor.formatOnSave" = false;
|
2022-06-02 16:35:34 +02:00
|
|
|
"editor.defaultFormatter" = "vscode.html-language-features";
|
2022-03-07 16:01:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
"[javascript]" = {
|
|
|
|
"editor.formatOnSave" = false;
|
|
|
|
"editor.defaultFormatter" = "vscode.typescript-language-features";
|
|
|
|
};
|
|
|
|
|
|
|
|
"[json]" = {
|
|
|
|
"editor.formatOnSave" = true;
|
2022-06-02 16:35:34 +02:00
|
|
|
"editor.defaultFormatter" = "vscode.json-language-features";
|
2022-03-07 16:01:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
"[jsonc]" = {
|
|
|
|
"editor.defaultFormatter" = "vscode.json-language-features";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
keybindings = [
|
|
|
|
{
|
|
|
|
key = "ctrl+[Period]";
|
|
|
|
command = "keyboard-quickfix.openQuickFix";
|
|
|
|
when = "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+k";
|
|
|
|
command = "selectPrevSuggestion";
|
|
|
|
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+j";
|
|
|
|
command = "selectNextSuggestion";
|
|
|
|
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+k";
|
|
|
|
command = "editor.action.moveLinesUpAction";
|
|
|
|
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+j";
|
|
|
|
command = "editor.action.moveLinesDownAction";
|
|
|
|
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+j";
|
|
|
|
command = "workbench.action.quickOpenNavigateNext";
|
|
|
|
when = "inQuickOpen";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+k";
|
|
|
|
command = "workbench.action.quickOpenNavigatePrevious";
|
|
|
|
when = "inQuickOpen";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+f";
|
|
|
|
command = "editor.action.formatDocument";
|
|
|
|
when = "editorTextFocus && !editorReadonly";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+o";
|
|
|
|
command = "editor.action.insertLineAfter";
|
|
|
|
when = "textInputFocus && !editorReadonly";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
key = "alt+shift+o";
|
|
|
|
command = "editor.action.insertLineBefore";
|
|
|
|
when = "textInputFocus && !editorReadonly";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
extensions = with pkgs.vscode-extensions; [
|
2022-06-02 16:35:34 +02:00
|
|
|
# WakaTime.vscode-wakatime
|
|
|
|
# dotjoshjohnson.xml
|
|
|
|
# eamodio.gitlens
|
|
|
|
# jock.svg
|
|
|
|
# ms-azuretools.vscode-docker
|
|
|
|
# ms-toolsai.jupyter
|
2024-01-23 08:51:55 +01:00
|
|
|
ms-vscode-remote.remote-ssh
|
2022-03-07 16:01:52 +01:00
|
|
|
# ms-vsliveshare.vsliveshare
|
|
|
|
bbenoist.nix
|
2023-05-08 02:45:35 +02:00
|
|
|
christian-kohler.path-intellisense
|
2023-07-28 17:59:34 +02:00
|
|
|
# coenraads.bracket-pair-colorizer-2
|
2022-03-07 16:01:52 +01:00
|
|
|
haskell.haskell
|
|
|
|
justusadam.language-haskell
|
2022-06-02 16:35:34 +02:00
|
|
|
justusadam.language-haskell
|
|
|
|
mechatroner.rainbow-csv
|
|
|
|
mhutchie.git-graph
|
|
|
|
ms-python.python
|
|
|
|
ms-python.vscode-pylance
|
2022-11-19 16:15:19 +01:00
|
|
|
ms-vscode-remote.remote-ssh
|
2022-06-02 16:35:34 +02:00
|
|
|
naumovs.color-highlight
|
2023-05-08 02:45:35 +02:00
|
|
|
oderwat.indent-rainbow
|
2022-06-02 16:35:34 +02:00
|
|
|
pkief.material-icon-theme
|
2022-03-07 16:01:52 +01:00
|
|
|
redhat.vscode-yaml
|
2022-06-02 16:35:34 +02:00
|
|
|
shardulm94.trailing-spaces
|
2022-03-07 16:01:52 +01:00
|
|
|
usernamehw.errorlens
|
2024-01-23 08:51:55 +01:00
|
|
|
rust-lang.rust-analyzer
|
2024-06-02 16:25:16 +02:00
|
|
|
mkhl.direnv
|
|
|
|
waderyan.gitblame
|
2023-07-28 17:59:34 +02:00
|
|
|
# vs-liveshare
|
2022-06-02 16:35:34 +02:00
|
|
|
vscodevim.vim
|
2022-03-07 16:01:52 +01:00
|
|
|
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
|
|
|
{
|
|
|
|
name = "monokai-st3";
|
|
|
|
publisher = "AndreyVolosovich";
|
|
|
|
version = "0.2.0";
|
|
|
|
sha256 = "1rvz5hlrfshy9laybxzvrdklx328s13j0lb8ljbda9zkadi3wcad";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "vscode-svgviewer";
|
|
|
|
publisher = "cssho";
|
|
|
|
version = "2.0.0";
|
|
|
|
sha256 = "06swlqiv3gc7plcbmzz795y6zwpxsdhg79k1n3jj6qngfwnv2p6z";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "comment-anchors";
|
|
|
|
publisher = "ExodiusStudios";
|
2024-01-23 08:51:55 +01:00
|
|
|
version = "1.10.3";
|
|
|
|
sha256 = "sha256-IyiiS4jpcghwKI0j8s69uGNZlKnZ0o78ZCT0oZeJER0=";
|
2022-03-07 16:01:52 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "vscode-test-explorer";
|
|
|
|
publisher = "hbenl";
|
|
|
|
version = "2.21.1";
|
|
|
|
sha256 = "022lnkq278ic0h9ggpqcwb3x3ivpcqjimhgirixznq0zvwyrwz3w";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "vscode-gutter-preview";
|
|
|
|
publisher = "kisstkondoros";
|
|
|
|
version = "0.29.0";
|
|
|
|
sha256 = "00vibv9xmhwaqiqzp0y2c246pqiqfjsw4bqx4vcdd67pz1wnqhg1";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "test-adapter-converter";
|
|
|
|
publisher = "ms-vscode";
|
2024-01-23 08:51:55 +01:00
|
|
|
version = "0.1.9";
|
|
|
|
sha256 = "sha256-M53jhAVawk2yCeSrLkWrUit3xbDc0zgCK2snbK+BaSs=";
|
2022-03-07 16:01:52 +01:00
|
|
|
}
|
2023-07-28 17:59:34 +02:00
|
|
|
# {
|
|
|
|
# name = "indent-rainbow";
|
|
|
|
# publisher = "oderwat";
|
|
|
|
# version = "8.2.2";
|
|
|
|
# sha256 = "1xxljwh66f21fzmhw8icrmxxmfww1s67kf5ja65a8qb1x1rhjjgf";
|
|
|
|
# }
|
2022-03-07 16:01:52 +01:00
|
|
|
{
|
|
|
|
name = "vscodeintellicode";
|
|
|
|
publisher = "VisualStudioExptTeam";
|
2024-01-23 08:51:55 +01:00
|
|
|
version = "1.2.30";
|
|
|
|
sha256 = "sha256-f2Gn+W0QHN8jD5aCG+P93Y+JDr/vs2ldGL7uQwBK4lE=";
|
2022-03-07 16:01:52 +01:00
|
|
|
}
|
2022-06-02 16:35:34 +02:00
|
|
|
{
|
|
|
|
name = "keyboard-quickfix";
|
|
|
|
publisher = "pascalsenn";
|
|
|
|
version = "0.0.6";
|
|
|
|
sha256 = "BK7ND6gtRVEitxaokJHmQ5rvSOgssVz+s9dktGQnY6M=";
|
|
|
|
}
|
2022-03-07 16:01:52 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|