merge: develop <--- feature/improve-cmp-cmdline

* HEAD
| \
| * 7c38526 <github@luxolus.com> nvim/plug: improve cmdline (:) completions
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
This commit is contained in:
Paul Stemmet 2023-04-02 16:00:20 +00:00
commit 5f07c09d46
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
2 changed files with 29 additions and 3 deletions

View File

@ -45,7 +45,6 @@ return function()
['<C-Space>'] = kmap.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true }),
}
defaults.mapping = mode.insert(defaults.mapping)
defaults.mapping = mode.cmd(defaults.mapping)
-- Sources of auto completion
--
@ -53,7 +52,7 @@ return function()
-- that is, 'path's will be shown before 'nvim_lsp's, etc
defaults.sources = sources(
{
{ name = 'path', },
{ name = 'async_path', },
},
{
{ name = 'nvim_lsp', keyword_length = 2 },
@ -91,4 +90,29 @@ return function()
}
cmp.setup(util.mconfig('config.nvim-cmp', defaults))
cmp.setup.cmdline(':', {
mapping = mode.cmd(),
sources = sources(
{
{ name = 'async_path', max_item_count = 2 },
},
{
{ name = 'cmdline_history', max_item_count = 2 },
{ name = 'cmdline', max_item_count = 6 },
}
)
})
cmp.setup.cmdline({'/', '?', '@'}, {
mapping = mode.cmd(),
sources = sources(
{
{ name = 'cmdline_history', max_item_count = 1 },
},
{
{ name = 'buffer', max_item_count = 9 },
}
)
})
end

View File

@ -149,8 +149,10 @@ local plugins = {
-- Other sources:
{ 'hrsh7th/cmp-vsnip' },
{ 'hrsh7th/cmp-path' },
{ 'FelipeLema/cmp-async-path' },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-cmdline' },
{ 'dmitmel/cmp-cmdline-history' },
{ 'f3fora/cmp-spell',
after = { 'lspconfig' },
config = require 'psoxizsh.plugins.config.cmp-spell'