Refactor
This commit is contained in:
parent
9b54b177af
commit
77bce04e39
27 changed files with 2 additions and 2 deletions
58
modules/home-manager/coding/neovim/config/plugins/cmp.nix
Normal file
58
modules/home-manager/coding/neovim/config/plugins/cmp.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
plugins.cmp = {
|
||||
enable = true;
|
||||
|
||||
autoEnableSources = true;
|
||||
|
||||
settings = {
|
||||
mapping = {
|
||||
"<C-e>" = "cmp.mapping.close()";
|
||||
|
||||
"<C-h>" = ''
|
||||
cmp.mapping(function()
|
||||
if ls.locally_jumpable(-1) then
|
||||
ls.jump(-1)
|
||||
end
|
||||
end)
|
||||
'';
|
||||
|
||||
"<C-l>" = ''
|
||||
cmp.mapping(function()
|
||||
if ls.expand_or_locally_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end)
|
||||
'';
|
||||
|
||||
"<C-n>" = "cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select })";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select })";
|
||||
|
||||
"<C-y>" = "cmp.mapping.confirm({ select = true })";
|
||||
|
||||
"<CR>" = "nil";
|
||||
"<S-Tab>" = "nil";
|
||||
"<Tab>" = "nil";
|
||||
};
|
||||
|
||||
snippet.expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "nvim_lua"; }
|
||||
{
|
||||
name = "luasnip";
|
||||
keyword_length = 2;
|
||||
}
|
||||
{
|
||||
name = "buffer";
|
||||
keyword_length = 3;
|
||||
}
|
||||
{ name = "calc"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue