aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/config
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-02-21 13:58:27 +0100
committerThomas Schmucker <ts@its1.de>2026-02-21 13:58:27 +0100
commit4ebaaec2b7635e32f78562dc2dbfdd0c66902b17 (patch)
tree14d4e013e4a5d0e650c3d1e16e5b91dd2f6052de /nvim/lua/config
parentb3da492bf2575ce82f68ed18181d68bd1ee1853f (diff)
downloaddotfiles-4ebaaec2b7635e32f78562dc2dbfdd0c66902b17.tar.gz
dotfiles-4ebaaec2b7635e32f78562dc2dbfdd0c66902b17.tar.bz2
dotfiles-4ebaaec2b7635e32f78562dc2dbfdd0c66902b17.zip
neovim: Keymaps und bessere Konfiguration für Copilot
Diffstat (limited to 'nvim/lua/config')
-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()