aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/config/keymaps.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/config/keymaps.lua')
-rw-r--r--nvim/lua/config/keymaps.lua29
1 files changed, 27 insertions, 2 deletions
diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua
index 72030c4..123e039 100644
--- a/nvim/lua/config/keymaps.lua
+++ b/nvim/lua/config/keymaps.lua
@@ -73,8 +73,33 @@ function M.gitsigns()
73end 73end
74 74
75function M.copilot() 75function M.copilot()
76 map("n", "<leader>ce", ":Copilot enable<CR>") 76 if vim.fn.exists(":Copilot") == 0 then return end
77 map("n", "<leader>cd", ":Copilot disable<CR>") 77
78 map("n", "<leader>ct", function()
79 local status = vim.fn["copilot#Enabled"]()
80
81 if status == 1 then
82 vim.cmd("Copilot disable")
83 print("Copilot disabled")
84 else
85 vim.cmd("Copilot enable")
86 print("Copilot enabled")
87 end
88 end, { desc = "Copilot Toggle" })
89
90 map("n", "<leader>ce", function()
91 vim.cmd("Copilot enable")
92 print("Copilot enabled")
93 end, { desc = "Copilot Enable" })
94
95 map("n", "<leader>cd", function()
96 vim.cmd("Copilot disable")
97 print("Copilot disabled")
98 end, { desc = "Copilot Disable" })
99
100 map("n", "<leader>cs", function()
101 vim.cmd("Copilot status")
102 end, { desc = "Copilot Status" })
78end 103end
79 104
80function M.global() 105function M.global()