aboutsummaryrefslogtreecommitdiff
path: root/user/home/kakoune/default.nix
blob: 54c3f0fbbd47d64deb87814dd31b79f3d21813df (plain) (blame)
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
{ config, pkgs, ... }:
{
  programs.kakoune = {
    enable = true;
    config = {
      colorScheme = "rose-pine";
      hooks = [
        {
          commands = "set window indentwidth 2";
          group = "indentwidth";
          name = "WinSetOption";
          option = "filetype=(nix)";
        }
        {
          commands = "lsp-enable-window";
          name = "WinSetOption";
          option = "filetype=(javascript|kotlin|qml|typescript|zig)";
        }
        {
          commands = ''
            set-option buffer lsp_servers %{
              [kotlin-language-server]
              root_globs = ["build.gradle.kts"]
            }
          '';
          name = "BufSetOption";
          option = "filetype=kotlin";
        }
        {
          commands = ''
            set-option buffer lsp_servers %{
              [qmlls]
              root_globs = ["shell.qml"]
            }
          '';
          name = "BufSetOption";
          option = "filetype=qml";
        }
      ];

      keyMappings = [
        {
          docstring = "Opens a new editor window";
          effect = ":new<ret>";
          key = "<c-w>";
          mode = "normal";
        }
      ];

      numberLines = {
        enable = true;
        highlightCursor = true;
      };

      ui = {
        assistant = "cat";
        setTitle = true;
      };
    };

    defaultEditor = true;
    extraConfig = builtins.readFile ./kakrc;
    plugins = with pkgs.kakounePlugins; [
      auto-pairs-kak
      kakoune-extra-filetypes
      kakoune-lsp
    ];
  };

  xdg.configFile."kak/colors" = {
    recursive = true;
    source = ./colors;
  };
}