[nvim] feat: add lua maps + cmp hierarchy

This commit is contained in:
David JULIEN 2021-11-20 16:02:59 +01:00
parent c6f0d78af6
commit 5b27863d03
2 changed files with 12 additions and 2 deletions

View File

@ -26,3 +26,11 @@ utils.map("n", "<leader>tl", "<cmd>Telescope live_grep<CR>")
-- colorscheme
utils.map("n", "<C-s>", "<cmd>lua require(\"astronomy\").toggle_variant()<CR>")
-- snippets
utils.map("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
utils.map("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
utils.map("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
utils.map("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
utils.map("i", "<C-E>", "<Plug>luasnip-next-choice", {})
utils.map("s", "<C-E>", "<Plug>luasnip-next-choice", {})

View File

@ -27,18 +27,20 @@ cmp.setup {
},
sources = {
{ name = "path" },
{ name = "buffer" },
{ name = "luasnip" },
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "treesitter" },
{ name = "calc" },
{ name = "spell" },
{ name = "treesitter" },
},
formatting = {
format = function(entry, vim_item)
vim_item.menu = ({
nvim_lsp = "[lsp]",
nvim_lua = "[nvim]",
luasnip = "[snip]",
path = "[path]",
buffer = "[buff]",
calc = "[calc]",