Added nvim-cmp

This commit is contained in:
Alejandro Angulo 2024-06-01 10:42:25 -07:00
parent f3f644aa53
commit 30e01ec5cf
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
2 changed files with 32 additions and 0 deletions

View file

@ -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

31
config/plugins/cmp.nix Normal file
View file

@ -0,0 +1,31 @@
{
plugins.cmp = {
enable = true;
settings = {
mapping = {
"<C-p>" = "cmp.mapping.scroll_docs(-4)";
"<C-n>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.abort()";
# Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
"<CR>" = "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;
}