From ea31b6b532ce31d5e86deca0603c0df1faea0e99 Mon Sep 17 00:00:00 2001 From: Einherjar Date: Mon, 4 Sep 2023 07:52:28 -0400 Subject: [PATCH] feat(copilot): enable/disable keybinding --- init.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index be40190..4f22260 100644 --- a/init.lua +++ b/init.lua @@ -308,6 +308,19 @@ require("lazy").setup({ help = true, }, }, + keys = { + { + "cp", + function() + if require("copilot.client").is_disabled() then + vim.cmd("Copilot enable") + else + vim.cmd("Copilot disable") + end + end, + desc = "Co[p]ilot Toggle", + }, + }, }, { "zbirenbaum/copilot-cmp", @@ -790,7 +803,12 @@ require("lazy").setup({ -- Better commit remaps with no "enter" dialog vim.keymap.set("n", "cc", "silent! Git commit --quiet", { silent = true, buffer = true }) vim.keymap.set("n", "ca", "silent! Git commit --quiet --amend", { silent = true, buffer = true }) - vim.keymap.set("n", "ce", "silent! Git commit --quiet --amend --no-edit", { silent = true, buffer = true }) + vim.keymap.set( + "n", + "ce", + "silent! Git commit --quiet --amend --no-edit", + { silent = true, buffer = true } + ) -- Push and Pull vim.keymap.set("n", "p", "silent! Git pull", { silent = true, buffer = true }) vim.keymap.set("n", "P", "silent! Git push", { silent = true, buffer = true })