add neovim snippets
This commit is contained in:
parent
05b26d29c9
commit
6aa4c24d02
1 changed files with 30 additions and 4 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue