diff options
author | listout <listout@protonmail.com> | 2022-08-25 01:14:33 +0530 |
---|---|---|
committer | listout <listout@protonmail.com> | 2022-09-01 16:26:42 +0530 |
commit | dd31843246ccdf9783f1b54d79b5e1ee22596399 (patch) | |
tree | 9b0f42dbe44fd0dd79d8de963092daf04671e6d9 /lua/plugins/coc-config.lua | |
parent | f07108dca88d47eeae67587011994c6179a7d035 (diff) |
[wip] better lua config for nvim
Signed-off-by: listout <listout@protonmail.com>
Diffstat (limited to 'lua/plugins/coc-config.lua')
-rw-r--r-- | lua/plugins/coc-config.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/plugins/coc-config.lua b/lua/plugins/coc-config.lua new file mode 100644 index 0000000..cd5f14f --- /dev/null +++ b/lua/plugins/coc-config.lua @@ -0,0 +1,13 @@ +-- Change leader to a comma +vim.g.mapleader = ',' + +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", "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("i", "<C-Space>", "coc#refresh()", { silent = true, expr = true }) +vim.api.nvim_set_keymap("i", "<tab>", "pumvisible() ? '<C-n>' : '<tab>'", {noremap = true, silent = true, expr = true}) +vim.api.nvim_set_keymap("i", "<S-TAB>", "pumvisible() ? '<C-p>' : '<C-h>'", {noremap = true, expr = true}) +vim.api.nvim_set_keymap("i", "<CR>", "pumvisible() ? coc#_select_confirm() : '<C-G>u<CR><C-R>=coc#on_enter()<CR>'", {silent = true, expr = true, noremap = true}) |