fix annoying cmp
This commit is contained in:
parent
be2a169edc
commit
72db99ff26
@ -100,7 +100,7 @@ function M.config()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 'c', 's' }),
|
||||
end, { 'i', 's' }),
|
||||
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
@ -110,7 +110,7 @@ function M.config()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's', 'c' }),
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
@ -121,33 +121,7 @@ function M.config()
|
||||
},
|
||||
}
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = {
|
||||
['<TAB>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item { behavior = cmp.SelectBehavior.Insert }
|
||||
else
|
||||
cmp.complete()
|
||||
cmp.select_next_item { behavior = cmp.SelectBehavior.Insert }
|
||||
end
|
||||
end, { 'i', 's', 'c' }),
|
||||
['<S-TAB>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item { behavior = cmp.SelectBehavior.Insert }
|
||||
else
|
||||
cmp.complete()
|
||||
end
|
||||
end, { 'i', 's', 'c' }),
|
||||
['<CR>'] = cmp.mapping {
|
||||
i = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false },
|
||||
c = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.confirm { behavior = cmp.ConfirmBehavior.Insert, select = true }
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'cmdline' },
|
||||
{ name = 'path' },
|
||||
@ -159,7 +133,6 @@ function M.config()
|
||||
})
|
||||
|
||||
cmp.setup.cmdline('/', {
|
||||
completion = { autocomplete = true },
|
||||
sources = {
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user