feat: add vimtex

This commit is contained in:
Fabio Lenherr 2023-02-23 12:54:16 +01:00
parent a373856ad5
commit 76b5001e19
4 changed files with 39 additions and 1 deletions

View file

@ -12,6 +12,7 @@ return {
},
opts = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
return {
completion = {
completeopt = "menu,menuone,noinsert",
@ -30,6 +31,28 @@ return {
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<C-j>"] = cmp.mapping(function(fallback)
if luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, {
"i",
"s",
}),
["<C-k>"] = cmp.mapping(function(fallback)
if luasnip.expand_or_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },