diff --git a/nvchad/.config/nvim/lua/custom/mappings.lua b/nvchad/.config/nvim/lua/custom/mappings.lua index e23127b..d7ac9a8 100644 --- a/nvchad/.config/nvim/lua/custom/mappings.lua +++ b/nvchad/.config/nvim/lua/custom/mappings.lua @@ -22,6 +22,16 @@ M.general = { ["J"] = { ":m '>+1gv=gv" }, ["K"] = { ":m '<-2gv=gv" }, }, + + i = { + [""] = { + function() + vim.fn.feedkeys(vim.fn["copilot#Accept"](), "") + end, + "Copilot Accept", + { replace_keycodes = true, nowait = true, silent = true, expr = true, noremap = true }, + }, + }, } -- more keybinds! diff --git a/nvchad/.config/nvim/lua/custom/plugins.lua b/nvchad/.config/nvim/lua/custom/plugins.lua index 9d09d71..c4eda81 100644 --- a/nvchad/.config/nvim/lua/custom/plugins.lua +++ b/nvchad/.config/nvim/lua/custom/plugins.lua @@ -47,6 +47,19 @@ local plugins = { end, }, + { + "github/copilot.vim", + lazy = false, + config = function() + -- Mapping tab is already used by NvChad + vim.g.copilot_no_tab_map = true; + vim.g.copilot_assume_mapped = true; + vim.g.copilot_tab_fallback = ""; + -- The mapping is set to other key, see custom/lua/mappings + -- or run ch to see copilot mapping section + end + }, + -- To make a plugin not be loaded -- { -- "NvChad/nvim-colorizer.lua",