aboutsummaryrefslogtreecommitdiff
path: root/modules/nvf.nix
blob: ad9a33e271d1d4e8ecf52c5ac236f07db24eaf53 (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
110
111
112
113
114
115
116
117
118
{ config, lib, pkgs, ... }:

{
  options.nvf.enable = lib.mkEnableOption "Setup nvf";
  config = lib.mkIf config.nvf.enable {
    programs.nvf = {
      enable = true;
      settings = {
        vim = {
          theme.enable = true;
          theme.name = "gruvbox";
          theme.transparent = true;
          theme.style = "dark";

          options = {
            clipboard = "unnamedplus";
            tabstop = 2;
            shiftwidth = 2;
            expandtab = true;
            autoindent = true;
            mouse = "a";
          };

          telescope.enable = true;
          autocomplete.nvim-cmp.enable = true;

          mini = {
            starter = {
              enable = true;
              setupOpts = {
                header = "  /l、     \n" +
                         "(゚、 。 7  \n" +
                         " l  ~ ヽ    \n" +
                         " じしf_,)ノ \n";
                footer = " ";
              };
            };
          };

          autopairs.nvim-autopairs.enable = true;

          git.enable = true;

          lsp = {
            enable = true;

            formatOnSave = true;
            lspkind.enable = true;
            lspSignature.enable = true;

          };

          diagnostics = {
            enable = true;
            config = {
              signs = {
                text = {
                  "vim.diagnostic.severity.ERROR" = " ";
                  "vim.diagnostic.severity.WARN" = " ";
                  "vim.diagnostic.severity.HINT" = " ";
                  "vim.diagnostic.severity.INFO" = " ";
                };
              };
              underline = true;
              virtual_lines = true;
            };
            nvim-lint.enable = true;
          };

          languages = {
            enableTreesitter = true;
            
            nix.enable = true;
            markdown.enable  = true;

            clang.enable = true;
            css.enable = true;
            html.enable = true;
            java.enable = true;
            ts.enable = true;
            go.enable = true;
            lua.enable = true;
            python.enable = true;
            typst.enable = true;
            # fails on darwin
            #tailwind.enable = true;
          };

          formatter.conform-nvim.enable = true;

          visuals = {
            nvim-web-devicons.enable = true;
          };

          snippets.luasnip.enable = true;

          binds = {
            whichKey.enable = true;
            cheatsheet.enable = true;
          };

          ui = {
            borders.enable = false;
          };

          autocmds = [
            {
              event = ["VimEnter"];
              command = "highlight Statusline guibg=none | highlight StatuslineNC guibg=none";
            }
          ];

          statusline.lualine.enable = true;
        };
      };
    };
  };
}