From 9c6fd2dc03239bc9287bae87e1dee18fcba8d7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Mon, 30 Sep 2024 23:02:36 +0200 Subject: [PATCH] Add copilot support --- lua/mappings.lua | 13 +++++++++++++ lua/plugins/init.lua | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/lua/mappings.lua b/lua/mappings.lua index 24149a9..c830170 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -19,4 +19,17 @@ M.dap_python = { } } + +M.copilot = { + n = { + [""] = { + function() + vim.fn.feedkeys(vim.fn['copilot#Accept'](), '') + end, + "Copilot Accept", + {replace_keycodes = true, nowait=true, silent=true, expr=true, noremap=true} + } + } +} + return M diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 693c591..6b2af81 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -33,6 +33,15 @@ return { "tpope/vim-fugitive", lazy = false, }, + { + "github/copilot.vim", + lazy = false, + config = function() + vim.g.copilot_no_tab_map = true; + vim.g.copilot_assume_mapped = true; + vim.g.copilot_tab_fallback = ""; + end + }, -- These are some examples, uncomment them if you want to see them work! -- { -- "neovim/nvim-lspconfig",