1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-11-13 01:21:13 +00:00

[neovim] Update copilotchat keymaps

This commit is contained in:
Daniel Carrillo 2024-05-01 13:05:42 +02:00
parent e7575a7c1f
commit 069882fcb8
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16

View File

@ -147,14 +147,20 @@ keymap(
)
-- Copilot
keymap({ "n", "v" }, "<leader>coa", function()
keymap({ "n", "v" }, "<leader>coh", function()
local actions = require("CopilotChat.actions")
require("CopilotChat.integrations.telescope").pick(actions.help_actions())
end, vim.tbl_extend("force", opts, { desc = "CopilotChat - Help actions" }))
keymap("n", "<leader>coh", function()
keymap({ "n", "v" }, "<leader>cop", function()
local actions = require("CopilotChat.actions")
require("CopilotChat.integrations.telescope").pick(actions.prompt_actions())
end, vim.tbl_extend("force", opts, { desc = "CopilotChat - Prompt actions" }))
keymap("n", "<leader>coq", function()
local input = vim.fn.input("Quick Chat: ")
if input ~= "" then
require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer })
end
end, vim.tbl_extend("force", opts, { desc = "CopilotChat - Quick chat" }))
-- Better paste
keymap("v", "p", "P", vim.tbl_extend("force", opts, { desc = "Paste" }))