mirror of
https://github.com/Dichgrem/DCGOS.git
synced 2025-12-17 03:31:59 -05:00
Init:start-nix
This commit is contained in:
56
home/tui/nixvim/plugins/nvim-cmp.nix
Executable file
56
home/tui/nixvim/plugins/nvim-cmp.nix
Executable file
@@ -0,0 +1,56 @@
|
||||
_: {
|
||||
programs.nixvim = {
|
||||
plugins.cmp = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert";
|
||||
};
|
||||
|
||||
mapping = {
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-y>" = "cmp.mapping.confirm { select = true }";
|
||||
"<C-Space>" = "cmp.mapping.complete {}";
|
||||
"<C-l>" = ''
|
||||
cmp.mapping(function()
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end, { 'i', 's' })
|
||||
'';
|
||||
"<C-h>" = ''
|
||||
cmp.mapping(function()
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
end, { 'i', 's' })
|
||||
'';
|
||||
};
|
||||
|
||||
snippet = {
|
||||
expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
sources = [
|
||||
{
|
||||
name = "luasnip";
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
}
|
||||
{
|
||||
name = "path";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user