cmp-cmdline
cmp-cmdline copied to clipboard
Support for magic mode
cmp.setup.cmdline('/', {
sources = {
{name = 'buffer'}
-- { name = 'rg'},
-- {name = 'fuzzy_buffer'}
}
})
magic search in vim simplifies regex but it confuses cmp.cmdline, eg when I search for import word:
/\vimp
the buffers will not show suggestions related to 'imp' but to 'vimp'. Issue is affecting other sources that are attached to cmdline sources
/imp
works ok though.
I hope there is way to filter out the magic characters.
How about this?
cmp.setup.cmdline('/', {
completion = { autocomplete = false },
sources = {
{
name = 'buffer',
option = {
keyword_pattern = [=[[^\v[:blank:]].*]=],
}
}
}
})
It seems to show the whole line for which there is a match rather than string itself.