From 36fe97222ae93007e1609ecdc0e83edd6e84bf05 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Wed, 29 Apr 2026 14:08:18 +0200 Subject: [PATCH] change accept autocomplete with TAB to CTRL+l --- README.md | 3 ++- lua/plugins/copilot.lua | 7 +++++++ lua/plugins/treesitter.lua | 1 - 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 56c81a0..524fffc 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ The **Leader Key** is set to `Space`. ### Copilot Code Completion | Action | Keybinding | Description | | :--- | :--- | :--- | +| **:Accept suggestion** | `Ctrl + l` | Accept suggested code from Copilot. | | **:Setup Copilot** | `:Copilot setup` | Authenticate and enable GitHub Copilot (disable cmd popups before proceeding with setup). | | **:Enable Copilot** | `:Copilot enable` | Enable GitHub Copilot after :Copilot disable. | | **:Disable Copilot** | `:Copilot disable` | Disable GitHub Copilot inline suggestions. | @@ -94,7 +95,7 @@ The **Leader Key** is set to `Space`. ### Window Management | Action | Keybinding | Description | | :--- | :--- | :--- | -| **Cycle Windows** | `Ctrl + w w` | Cycle focus between open windows (). | +| **Cycle Windows** | `Ctrl + w w` | Cycle focus between open windows. | | **Move Down** | `Ctrl + w j` | Move focus to the window below. | | **Move Up** | `Ctrl + w k` | Move focus to the window above. | | **Move Up** | `Ctrl + w s` | Duplicate window (horizontal). | diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index 27c0ef6..c4c3ab2 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -1,4 +1,11 @@ return { "github/copilot.vim", lazy = false, + config = function() + vim.g.copilot_no_tab_map = true + vim.keymap.set('i', '', 'copilot#Accept("\\")', { + expr = true, + replace_keycodes = false + }) + end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 25d5d60..72d053c 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,7 +1,6 @@ return { "nvim-treesitter/nvim-treesitter", lazy = false, - -- event = { "BufReadPost", "BufNewFile" }, build = ":TSUpdate", config = function() require("nvim-treesitter").setup({