1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-07-03 08:59:24 +00:00

[neovim] Add copilot

This commit is contained in:
2024-02-12 20:46:40 +01:00
parent 64cf03dcac
commit d1c002183f
10 changed files with 72 additions and 24 deletions

View File

@ -122,7 +122,7 @@ keymap(
keymap(
"n",
"<leader>lr",
"<cmd>Lspsaga rename<cr>",
"<cmd>Lspsaga rename mode=n<cr>",
vim.tbl_extend("force", opts, { desc = "Open a dialog to rename a code element" })
)
keymap(
@ -132,7 +132,7 @@ keymap(
vim.tbl_extend("force", opts, { desc = "Peek the definition of the directive under the cursor" })
)
keymap(
{"n", "v"},
{ "n", "v" },
"<leader>lf",
"<cmd>lua vim.lsp.buf.format{ async=true }<cr>",
vim.tbl_extend("force", opts, { desc = "Format the current buffer or selection" })
@ -152,6 +152,20 @@ keymap(
vim.tbl_extend("force", opts, { desc = "Run tests on the current file" })
)
-- Copilot
keymap(
"n",
"<leader>coe",
"<cmd>CopilotChatExplain<cr>",
vim.tbl_extend("force", opts, { desc = "CopilotChat - Explain code" })
)
keymap(
"n",
"<leader>cot",
"<cmd>CopilotChatTests<cr>",
vim.tbl_extend("force", opts, { desc = "CopilotChat - Generate tests" })
)
-- Better paste
keymap("v", "p", "P", vim.tbl_extend("force", opts, { desc = "Paste" }))