feat: toggle copilot

This commit is contained in:
ralvescosta 2025-04-19 09:07:20 -03:00
parent da10cd3d52
commit 4917cc23db
1 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,20 @@
return { return {
{ {
'github/copilot.vim', 'github/copilot.vim',
config = function()
vim.g.copilot_enabled = false
vim.api.nvim_create_user_command('CopilotToggle', function()
if vim.g.copilot_enabled == 1 then
vim.g.copilot_enabled = 0
print 'Copilot: OFF'
else
vim.g.copilot_enabled = 1
print 'Copilot: ON'
end
end, {})
vim.keymap.set('n', '<leader>tc', ':CopilotToggle<CR>', { desc = '[T]oggle [C]opilot', silent = true })
end,
}, },
} }