nvim: simplify completion sources
This commit is contained in:
parent
eb786ea5a8
commit
71f3cf6e45
|
@ -43,6 +43,8 @@ if cmp and luasnip then
|
|||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'dictionary' },
|
||||
{ name = 'zsh' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
|
@ -50,25 +52,6 @@ if cmp and luasnip then
|
|||
})
|
||||
})
|
||||
|
||||
-- set configuration for specific filetypes
|
||||
cmp.setup.filetype('lua', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'nvim_lua' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.filetype({ 'gitcommit', 'NeogitCommitMessage' }, {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'dictionary' }
|
||||
}, {
|
||||
{ name = 'buffer' }
|
||||
})
|
||||
})
|
||||
|
||||
-- Use buffer source for `/`
|
||||
cmp.setup.cmdline('/', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
|
@ -93,6 +76,9 @@ if cmp and luasnip then
|
|||
dic = {
|
||||
['gitcommit'] =
|
||||
vim.fn.stdpath('config') .. '/resources/git.dict',
|
||||
-- doesn't work, filetype is probably set too late
|
||||
['NeogitCommitMessage'] =
|
||||
vim.fn.stdpath('config') .. '/resources/git.dict',
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue