Adjusting COC
This commit is contained in:
44
lua/coc.lua
44
lua/coc.lua
@@ -0,0 +1,44 @@
|
||||
-- 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 })
|
||||
Reference in New Issue
Block a user