You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

60 lines
2.1 KiB

-- local cmp_autopairs = require('nvim-autopairs.completion.cmp')
return {
opts = {
cmdline = { enabled = false },
snippets = { preset = 'default' },
completion = {
keyword = { range = 'full' }, --'prefix', 'full'
accept = {
auto_brackets = { enabled = false },
},
list = {
selection = {
preselect = false,
auto_insert = true,
},
},
menu = {
auto_show = true,
},
documentation = {
auto_show = true,
auto_show_delay_ms = 500,
},
ghost_text = { enabled = true },
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
keymap = {
preset = 'none',
-- ['<C-h>'] = { 'show', 'show_documentation', 'hide_documentation' },
['<C-h>'] = { 'hide', 'fallback' },
['<Space>'] = { 'accept', 'fallback' },
--['<CR>'] = { 'select_and_accept', 'fallback' },
['<CR>'] = { 'accept', 'fallback' },
-- ['<Space>'] = { function(cmp)
-- return cmp.accept({ callback = cmp_autopairs.on_confirm_done })
-- end },
-- ['<CR>'] = { function(cmp)
-- return cmp.select_and_accept({ callback = cmp_autopairs.on_confirm_done })
-- end },
['<S-Tab>'] = { 'select_prev', 'fallback' },
['<Tab>'] = { 'select_next', 'fallback' },
['<C-p>'] = { 'select_prev', 'fallback_to_mappings' },
['<C-n>'] = { 'select_next', 'fallback_to_mappings' },
['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
['<C-j>'] = { 'snippet_forward', 'fallback' },
['<C-k>'] = { 'snippet_backward', 'fallback' },
['<C-l>'] = { 'show_signature', 'hide_signature', 'fallback' },
},
signature = { enabled = true },
}
}