add neovim snippets

This commit is contained in:
Anthony Rodriguez 2024-08-27 15:25:58 +02:00
parent 05b26d29c9
commit 6aa4c24d02
Signed by: nezia
GPG key ID: EE3BE97C040A86CE

View file

@ -196,13 +196,36 @@
"<C-e>" = "cmp.mapping.close()"; "<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)"; "<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = true })"; "<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-Tab>" = "<S-Tab>" = ''
"cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; cmp.mapping(function (fallback)
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; local luasnip = require('luasnip')
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {'i', 's'})
'';
"<Tab>" = ''
cmp.mapping(function (fallback)
local luasnip = require('luasnip')
if luasnip.expandable() then
luasnip.expand()
elseif cmp.visible() then
cmp.select_next_item()
elseif luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, {'i', 's'})
'';
}; };
sources = sources =
[ { name = "nvim_lsp"; } { name = "path"; } { name = "buffer"; } ]; [ { name = "nvim_lsp"; } { name = "path"; } { name = "buffer"; } { name = "luasnip"; } ];
}; };
}; };
cmp-nvim-lsp.enable = true; cmp-nvim-lsp.enable = true;
@ -211,6 +234,9 @@
enable = true; enable = true;
}; };
luasnip.enable = true;
friendly-snippets.enable = true;
neo-tree = { neo-tree = {
enable = true; enable = true;
useDefaultMappings = true; useDefaultMappings = true;