From b51f9bc1014ce350abe73f2c419e0bf6512194c2 Mon Sep 17 00:00:00 2001 From: Andrey0189 Date: Wed, 17 Apr 2024 05:52:14 +0500 Subject: Initial commit --- nixos/modules/nixvim/plugins/cmp.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 nixos/modules/nixvim/plugins/cmp.nix (limited to 'nixos/modules/nixvim/plugins/cmp.nix') diff --git a/nixos/modules/nixvim/plugins/cmp.nix b/nixos/modules/nixvim/plugins/cmp.nix new file mode 100644 index 0000000..66afc03 --- /dev/null +++ b/nixos/modules/nixvim/plugins/cmp.nix @@ -0,0 +1,32 @@ +{ + programs.nixvim.plugins.cmp = { + enable = true; + + settings = { + snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + + mapping = { + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + "" = "cmp.mapping.confirm({ select = true })"; + }; + + sources = [ + {name = "path";} + {name = "nvim_lsp";} + {name = "cmp_tabby";} + {name = "luasnip";} + { + name = "buffer"; + # Words from other open buffers can also be suggested. + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + } + {name = "neorg";} + ]; + }; + }; +} -- cgit v1.2.3