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.
 
 
 

21 lines
1.4 KiB

vim.o.signcolumn = 'number'
-- Bind tab to select next tab complete
vim.api.nvim_set_keymap("i", "<TAB>", "pumvisible() ? '<C-n>' : '<TAB>'", {noremap = true, silent = true, expr = true})
vim.api.nvim_set_keymap("n", "<leader>.", "<Plug>(coc-codeaction)", {})
vim.api.nvim_set_keymap("n", "<leader>l", ":CocCommand eslint.executeAutofix<CR>", {})
vim.api.nvim_set_keymap("n", "gd", "<Plug>(coc-definition)", {silent = true})
vim.api.nvim_set_keymap("n", "gr", "<Plug>(coc-references)", {silent = true})
vim.api.nvim_set_keymap("n", "K", ":call CocActionAsync('doHover')<CR>", {silent = true, noremap = true})
vim.api.nvim_set_keymap("n", "<leader>rn", "<Plug>(coc-rename)", {})
vim.api.nvim_set_keymap("n", "<leader>f", ":CocCommand prettier.formatFile<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "g[", ":call CocActionAsync('diagnosticPrevious')<CR>", {silent = true, noremap = true})
vim.api.nvim_set_keymap("n", "g]", ":call CocActionAsync('diagnosticNext')<CR>", {silent = true, noremap = true})
vim.keymap.set("n", "<C-space>", vim.fn['coc#refresh'](), {silent = true, noremap = true})
-- Bind Ctrl + j,k to up and down for COC completion
vim.api.nvim_set_keymap('i', '<C-j>', "pumvisible() ? '<Down>' : '<C-j>'", { noremap = true, expr = true, silent = true })
vim.api.nvim_set_keymap('i', '<C-k>', "pumvisible() ? '<Up>' : '<C-k>'", { noremap = true, expr = true, silent = true })