summaryrefslogtreecommitdiffstats
path: root/nixos/modules/nixvim/plugins/cmp.nix
diff options
context:
space:
mode:
authorAndrey01892024-04-17 05:52:14 +0500
committerAndrey01892024-04-17 05:52:14 +0500
commitb51f9bc1014ce350abe73f2c419e0bf6512194c2 (patch)
tree404799cc86717de0a7115bbcec32ce0d8851241b /nixos/modules/nixvim/plugins/cmp.nix
downloadnix-old-b51f9bc1014ce350abe73f2c419e0bf6512194c2.tar.gz
nix-old-b51f9bc1014ce350abe73f2c419e0bf6512194c2.tar.bz2
nix-old-b51f9bc1014ce350abe73f2c419e0bf6512194c2.zip
Initial commit
Diffstat (limited to 'nixos/modules/nixvim/plugins/cmp.nix')
-rw-r--r--nixos/modules/nixvim/plugins/cmp.nix32
1 files changed, 32 insertions, 0 deletions
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 = {
+ "<C-d>" = "cmp.mapping.scroll_docs(-4)";
+ "<C-f>" = "cmp.mapping.scroll_docs(4)";
+ "<C-Space>" = "cmp.mapping.complete()";
+ "<C-e>" = "cmp.mapping.close()";
+ "<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
+ "<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
+ "<CR>" = "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";}
+ ];
+ };
+ };
+}