aboutsummaryrefslogtreecommitdiff
path: root/nvim
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
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')
-rw-r--r--nvim/lua/config/keymaps.lua29
-rw-r--r--nvim/lua/plugins/copilot.lua7
2 files changed, 32 insertions, 4 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()
diff --git a/nvim/lua/plugins/copilot.lua b/nvim/lua/plugins/copilot.lua
index 392e831..8f0bd52 100644
--- a/nvim/lua/plugins/copilot.lua
+++ b/nvim/lua/plugins/copilot.lua
@@ -3,7 +3,9 @@ return {
3 -- enabled = false, 3 -- enabled = false,
4 4
5 event = "InsertEnter", 5 event = "InsertEnter",
6 config = function() 6 init = function()
7 -- vim.g.copilot_no_tab_map = true
8
7 vim.g.copilot_filetypes = { 9 vim.g.copilot_filetypes = {
8 ["*"] = false, -- Standardmäßig aus, ... 10 ["*"] = false, -- Standardmäßig aus, ...
9 11
@@ -21,7 +23,8 @@ return {
21 css = true, 23 css = true,
22 markdown = true, 24 markdown = true,
23 } 25 }
24 26 end,
27 config = function()
25 local keymaps = require("config.keymaps") 28 local keymaps = require("config.keymaps")
26 keymaps.copilot() 29 keymaps.copilot()
27 end, 30 end,