From 30e01ec5cfe2998c05da0c66d00b9c9a140a3e97 Mon Sep 17 00:00:00 2001 From: Alejandro Angulo Date: Sat, 1 Jun 2024 10:42:25 -0700 Subject: [PATCH] Added nvim-cmp --- config/default.nix | 1 + config/plugins/cmp.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 config/plugins/cmp.nix diff --git a/config/default.nix b/config/default.nix index 3f572c5..1632a38 100644 --- a/config/default.nix +++ b/config/default.nix @@ -2,6 +2,7 @@ # Import all your configuration modules here # imports = [./bufferline.nix]; imports = [ + ./plugins/cmp.nix ./plugins/gitsigns.nix ./plugins/lsp.nix ./plugins/lualine.nix diff --git a/config/plugins/cmp.nix b/config/plugins/cmp.nix new file mode 100644 index 0000000..55452ed --- /dev/null +++ b/config/plugins/cmp.nix @@ -0,0 +1,31 @@ +{ + plugins.cmp = { + enable = true; + settings = { + mapping = { + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.abort()"; + # Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + "" = "cmp.mapping.confirm({ select = true })"; + }; + + snippet.expand = '' + function(args) + require('luasnip').lsp_expand(args.body) + end + ''; + + sources = [ + {name = "buffer";} + {name = "cmdline";} + {name = "luasnip";} + {name = "nvim_lsp";} + {name = "path";} + ]; + }; + }; + + plugins.luasnip.enable = true; +}