DEVELOPMENT ENVIRONMENT

~liljamo/nvim-flake

ref: 539075b769cd3ad58ce7645f5b80228004e54490 nvim-flake/config/plugins/cmp.nix -rw-r--r-- 973 bytes
539075b7Jonni Liljamo feat(toggleterm): init with lazygit toggle 3 months 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
{
  opts = {
    completeopt = [ "menu" "menuone" "noselect"];
  };
  extraConfigLua = ''
    vim.opt.shortmess:append "c"
  '';
  plugins = {
    cmp = {
      enable = true;
      settings = {
        sources = [
          { name = "nvim_lsp"; }
          { name = "async_path"; }
          { name = "buffer"; }
        ];
        mapping = {
          "<C-n>" = "cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }";
          "<C-p>" = "cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }";
          "<C-y>" = ''
            cmp.mapping(
              cmp.mapping.confirm {
                behavior = cmp.ConfirmBehavior.Insert,
                select = true,
              },
              { "i", "c" }
            )
          '';
        };
      };
    };
    cmp-async-path.enable = true;
    cmp-buffer.enable = true;
    cmp-nvim-lsp.enable = true;

    lspkind = {
      enable = true;
      cmp.enable = true;
    };
  };
}