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({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'nvim_lua' },
|
||||||
|
{ name = 'dictionary' },
|
||||||
{ name = 'zsh' },
|
{ name = 'zsh' },
|
||||||
}, {
|
}, {
|
||||||
{ name = 'buffer' },
|
{ 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 `/`
|
-- Use buffer source for `/`
|
||||||
cmp.setup.cmdline('/', {
|
cmp.setup.cmdline('/', {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
@ -93,6 +76,9 @@ if cmp and luasnip then
|
||||||
dic = {
|
dic = {
|
||||||
['gitcommit'] =
|
['gitcommit'] =
|
||||||
vim.fn.stdpath('config') .. '/resources/git.dict',
|
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