DEVELOPMENT ENVIRONMENT

~liljamo/nvim-flake

ref: 439a278adc35eeefbc2049cdade587e0f2e7d37e nvim-flake/config/plugins/lsp.nix -rw-r--r-- 2.0 KiB
439a278aJonni Liljamo feat(lsp): rename bind 20 hours ago
                                                                                
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
{pkgs, ...}: {
  plugins = {
    lsp = {
      enable = true;
      inlayHints = true;
      servers = {
        gopls.enable = true;
        html.enable = true;
        htmx.enable = true;
        nixd.enable = true;
        protols = {
          enable = true;
          package = pkgs.protols;
        };
        basedpyright.enable = true;
        qmlls = {
          enable = true;
          cmd = ["qmlls" "-E"];
        };
        rust_analyzer = {
          enable = true;
          installCargo = false;
          installRustc = false;
          settings = {
            cargo.loadOutDirsFromCheck = true;
            check.command = "clippy";
            completion.postfix.enable = false;
            inlayHints = {
              closureCaptureHints.enable = true;
              closureReturnTypeHints.enable = "always";
              implicitDrops.enable = true;
              implicitSizedBoundHints.enable = true;
            };
          };
        };
        taplo.enable = true;
        tailwindcss = {
          enable = true;
          filetypes = ["htmldjango" "html" "markdown" "rust" "templ"];
        };
        templ.enable = true;
        yamlls.enable = true;
      };
    };
    lsp-lines.enable = true;
    lsp-signature = {
      enable = true;
      settings = {
        doc_lines = 0;
        handler_opts.border = "none";
        hint_enable = false;
      };
    };
    fidget.enable = true;
  };

  extraConfigLua = ''
    -- disable inline diagnostic messages,
    -- but enable virtual lines for lsp-lines
    vim.diagnostic.config({ virtual_text = false, virtual_lines = true })
  '';

  keymaps = [
    {
      action = "<cmd>lua vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())<CR>";
      key = "<leader>ti";
      options.desc = "toggle inlay hints";
    }
    {
      action.__raw = ''
        function()
          vim.lsp.buf.rename()
          vim.cmd('silent! wa')
        end
      '';
      key = "<leader>lar";
      options.desc = "LSP rename and save all buffers";
    }
  ];
}