From e02c001c30cf956c5dd312d134633bd0f7b41b27 Mon Sep 17 00:00:00 2001 From: Mosab Ibrahim Date: Mon, 6 Jul 2026 10:27:19 +0100 Subject: [PATCH] Disabling Github Copilot for now --- .claude/settings.local.json | 11 +++++- nvim/lua/plugins/astrocore.lua | 9 +---- nvim/lua/plugins/copilot.lua | 71 ---------------------------------- nvim/lua/polish.lua | 15 ------- 4 files changed, 11 insertions(+), 95 deletions(-) delete mode 100644 nvim/lua/plugins/copilot.lua diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 8a853b8..a356921 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -2,7 +2,16 @@ "permissions": { "allow": [ "Bash(python3:*)", - "Bash(git pull:*)" + "Bash(git pull:*)", + "Read(//Users/mosab/.config/jj/**)", + "Read(//Users/mosab/**)", + "Bash(jj nt *)", + "Bash(gh --version)", + "Bash(gh auth *)", + "Bash(brew info *)", + "Bash(brew upgrade *)", + "Bash(arch -arm64 brew upgrade gh)", + "Bash(jc submit *)" ] } } diff --git a/nvim/lua/plugins/astrocore.lua b/nvim/lua/plugins/astrocore.lua index 50f3871..436b4f8 100644 --- a/nvim/lua/plugins/astrocore.lua +++ b/nvim/lua/plugins/astrocore.lua @@ -83,23 +83,16 @@ return { }, -- Insert mode mappings for completion i = { - -- Tab key for accepting completions (including Copilot) [""] = { function() - -- First try to accept Copilot suggestion - if vim.g.ai_accept and vim.g.ai_accept() then - return - end - -- If no Copilot suggestion, try blink.cmp if require("blink.cmp").is_visible() then require("blink.cmp").accept() else - -- Fallback to regular tab return "" end end, expr = true, - desc = "Accept completion or Copilot suggestion", + desc = "Accept completion", }, -- Shift-Tab for previous completion [""] = { diff --git a/nvim/lua/plugins/copilot.lua b/nvim/lua/plugins/copilot.lua deleted file mode 100644 index de7d5c5..0000000 --- a/nvim/lua/plugins/copilot.lua +++ /dev/null @@ -1,71 +0,0 @@ -return { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - build = ":Copilot auth", - event = "InsertEnter", - config = function(_, opts) - require("copilot").setup(opts) - end, - opts = { - panel = { - enabled = true, - auto_refresh = false, - keymap = { - jump_prev = "[[", - jump_next = "]]", - accept = "", - refresh = "gr", - open = "" - }, - layout = { - position = "bottom", - ratio = 0.4 - }, - }, - suggestion = { - enabled = true, - auto_trigger = true, - debounce = 75, - keymap = { - accept = false, -- handled by completion engine - accept_word = false, - accept_line = false, - next = "", - prev = "", - dismiss = "", - }, - }, - filetypes = { - yaml = true, -- Enable for YAML (useful for configs, CI/CD files) - markdown = true, -- Enable for Markdown (useful for documentation) - help = false, - gitcommit = true, -- Enable for git commits (often amusing suggestions) - gitrebase = false, - hgcommit = false, - svn = false, - cvs = false, - ["."] = false, - }, - copilot_node_command = 'node', - server_opts_overrides = {}, - }, - specs = { - { - "AstroNvim/astrocore", - opts = { - options = { - g = { - -- set the ai_accept function - ai_accept = function() - if require("copilot.suggestion").is_visible() then - require("copilot.suggestion").accept() - return true - end - end, - }, - }, - }, - }, - }, -} - diff --git a/nvim/lua/polish.lua b/nvim/lua/polish.lua index 6a7ce39..f06276c 100644 --- a/nvim/lua/polish.lua +++ b/nvim/lua/polish.lua @@ -97,18 +97,3 @@ vim.api.nvim_create_autocmd("FileType", { vim.opt_local.spelllang = "en_us" end, }) - --- GitHub Copilot performance optimization for large files --- Disable Copilot for files larger than 100KB to improve performance -vim.api.nvim_create_autocmd("BufReadPre", { - pattern = "*", - callback = function() - local file = vim.fn.expand("") - local size = vim.fn.getfsize(file) - - -- Disable Copilot for files larger than 100KB or if size cannot be determined - if size > 100000 or size == -2 then - vim.b.copilot_enabled = false - end - end, -})