From b3da492bf2575ce82f68ed18181d68bd1ee1853f Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 21 Feb 2026 13:00:37 +0100 Subject: neovim: aktiviere Github-Copilot --- nvim/lua/config/keymaps.lua | 5 +++++ nvim/lua/plugins/copilot.lua | 26 +++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 2c1d383..72030c4 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -72,6 +72,11 @@ function M.gitsigns() map("n", "tb", require("gitsigns").toggle_current_line_blame) end +function M.copilot() + map("n", "ce", ":Copilot enable") + map("n", "cd", ":Copilot disable") +end + function M.global() local opts = { silent = true, diff --git a/nvim/lua/plugins/copilot.lua b/nvim/lua/plugins/copilot.lua index bcd4480..392e831 100644 --- a/nvim/lua/plugins/copilot.lua +++ b/nvim/lua/plugins/copilot.lua @@ -1,4 +1,28 @@ return { "github/copilot.vim", - enabled = false, + -- enabled = false, + + event = "InsertEnter", + config = function() + vim.g.copilot_filetypes = { + ["*"] = false, -- Standardmäßig aus, ... + + -- außer für diese Dateitypen: + lua = true, + python = true, + javascript = true, + typescript = true, + go = true, + cpp = true, + c = true, + rust = true, + java = true, + html = true, + css = true, + markdown = true, + } + + local keymaps = require("config.keymaps") + keymaps.copilot() + end, } -- cgit v1.3