Skip to content

Commit

Permalink
feat(copilot): enable/disable keybinding
Browse files Browse the repository at this point in the history
  • Loading branch information
realeinherjar committed Sep 4, 2023
1 parent ce34187 commit ea31b6b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,19 @@ require("lazy").setup({
help = true,
},
},
keys = {
{
"<leader>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",
Expand Down Expand Up @@ -790,7 +803,12 @@ require("lazy").setup({
-- Better commit remaps with no "enter" dialog
vim.keymap.set("n", "cc", "<CMD>silent! Git commit --quiet<CR>", { silent = true, buffer = true })
vim.keymap.set("n", "ca", "<CMD>silent! Git commit --quiet --amend<CR>", { silent = true, buffer = true })
vim.keymap.set("n", "ce", "<CMD>silent! Git commit --quiet --amend --no-edit<CR>", { silent = true, buffer = true })
vim.keymap.set(
"n",
"ce",
"<CMD>silent! Git commit --quiet --amend --no-edit<CR>",
{ silent = true, buffer = true }
)
-- Push and Pull
vim.keymap.set("n", "p", "<CMD>silent! Git pull<CR>", { silent = true, buffer = true })
vim.keymap.set("n", "P", "<CMD>silent! Git push<CR>", { silent = true, buffer = true })
Expand Down

0 comments on commit ea31b6b

Please sign in to comment.