nvim: changed completion source order

This commit is contained in:
PowerUser64 2021-11-25 04:30:58 -08:00
parent e048d023a5
commit 8e69c8385a

View file

@ -121,6 +121,10 @@ M.cmp = function()
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
-- select = true,
},
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -138,12 +142,11 @@ M.cmp = function()
},
sources = {
{ name = 'path' },
{ name = 'nvim_lsp' },
{ name = 'buffer' },
{ name = 'calc' },
{ name = 'nvim_lua' },
{ name = 'nvim_lsp' },
{ name = 'calc' },
{ name = 'spell' },
{ name = 'treesitter' },
{ name = 'buffer' },
{ name = 'emoji' },
},
formatting = {
@ -153,12 +156,11 @@ M.cmp = function()
-- set a name for each source
vim_item.menu = ({
path = "[Path]",
nvim_lsp = "[LSP]",
buffer = "[Buffer]",
calc = "[Calc]",
nvim_lua = "[Lua]",
nvim_lsp = "[LSP]",
calc = "[Calc]",
spell = "[Spell]",
treesitter = "[TS]",
buffer = "[Buffer]",
})[entry.source.name]
return vim_item
end,
@ -234,7 +236,7 @@ M.lspconfig = function()
end
-- From kickstart.nvim:
if (vim.fn.executable(sumneko_binary) == true) then
if (vim.fn.executable(sumneko_binary) == 1) then
-- Make runtime files discoverable to the server
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')