summary refs log tree commit diff
path: root/configs/vscode/settings.nix
blob: 4e2fba10ded211dbcb2ff25bc2ef2d2d929698d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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;
}