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,

View file

@ -61,19 +61,25 @@ return require('packer').startup(function()
require('lsp').cmp()
end,
requires = { -- nvim-cmp sources
"hrsh7th/vim-vsnip",
"rafamadriz/friendly-snippets",
-- snippet integration
-- "hrsh7th/cmp-vsnip",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-latex-symbols",
"hrsh7th/cmp-vsnip",
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-calc",
"hrsh7th/cmp-look",
}
}
use { -- code snippits
"L3MON4D3/LuaSnip",
-- "hrsh7th/vim-vsnip",
-- "rafamadriz/friendly-snippets",
}
use { -- function parameter previews
"ray-x/lsp_signature.nvim",
after = "nvim-lspconfig",