44 lines
915 B
Lua
44 lines
915 B
Lua
-- CoC configuration
|
|
vim.g.coc_global_extensions = {
|
|
'coc-json',
|
|
'coc-html',
|
|
'coc-css',
|
|
'coc-python',
|
|
'coc-clangd',
|
|
'coc-rust-analyzer',
|
|
'coc-yaml',
|
|
'coc-tsserver',
|
|
'coc-lua',
|
|
'coc-sh',
|
|
'coc-go',
|
|
'coc-prettier',
|
|
'coc-eslint',
|
|
'coc-markdownlint',
|
|
'coc-vimlsp'
|
|
}
|
|
|
|
-- Use <Tab> and <S-Tab> to navigate completion list
|
|
vim.keymap.set('i', '<Tab>', function()
|
|
if vim.fn['coc#pum#visible']() == 1 then
|
|
return vim.fn['coc#pum#next'](1)
|
|
else
|
|
return '<Tab>'
|
|
end
|
|
end, { expr = true, silent = true })
|
|
|
|
vim.keymap.set('i', '<S-Tab>', function()
|
|
if vim.fn['coc#pum#visible']() == 1 then
|
|
return vim.fn['coc#pum#prev'](1)
|
|
else
|
|
return '<S-Tab>'
|
|
end
|
|
end, { expr = true, silent = true })
|
|
|
|
-- Use <CR> to confirm completion
|
|
vim.keymap.set('i', '<CR>', function()
|
|
if vim.fn['coc#pum#visible']() == 1 then
|
|
return vim.fn['coc#pum#confirm']()
|
|
else
|
|
return '<CR>'
|
|
end
|
|
end, { expr = true, silent = true }) |