From 069882fcb882dd4b22314084d4b76f45af81e698 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Wed, 1 May 2024 13:05:42 +0200 Subject: [PATCH] [neovim] Update copilotchat keymaps --- .config/nvim/lua/core/keymaps.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index e8c6572..58cdb20 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua @@ -147,14 +147,20 @@ keymap( ) -- Copilot -keymap({ "n", "v" }, "coa", function() +keymap({ "n", "v" }, "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", "coh", function() +keymap({ "n", "v" }, "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", "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" }))