Fixed a terrible nvim bug where pressing tab would error and type a 0

This commit is contained in:
PowerUser64 2021-09-10 01:40:44 -07:00
parent 2fa03f227e
commit ac9a7343c6
2 changed files with 22 additions and 13 deletions

View file

@ -99,15 +99,15 @@ end
-- <<<
M.cmp = function() ---- cmp >>>
-- nvim-cmp supports additional completion capabilities
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- luasnip setup
local luasnip = require 'luasnip'
-- nvim-cmp setup
local cmp = require 'cmp'
cmp.setup {
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = {
@ -144,7 +144,7 @@ M.cmp = function() ---- cmp >>>
{ name = 'path' },
{ name = 'buffer' },
{ name = 'calc' },
{ name = 'vsnip' },
{ name = 'luasnip' },
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'spell' },
@ -158,11 +158,14 @@ M.cmp = function() ---- cmp >>>
-- set a name for each source
vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
luasnip = "[LuaSnip]",
nvim_lua = "[Lua]",
latex_symbols = "[Latex]",
path = "[Path]",
buffer = "[Buffer]",
calc = "[Calc]",
luasnip = "[LuaSnip]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
spell = "[Spell]",
treesitter = "[TS]",
})[entry.source.name]
return vim_item
end,