From 0141de5795eeae57d80cd296f57aba801eab8f4f Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Wed, 5 Jul 2023 12:54:27 +0200 Subject: [PATCH] feat(nvim): add github copilot --- home-manager/neovim/copilot.lua | 6 ++++++ home-manager/neovim/default.nix | 6 ++++++ home-manager/neovim/nvim-cmp.lua | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 home-manager/neovim/copilot.lua diff --git a/home-manager/neovim/copilot.lua b/home-manager/neovim/copilot.lua new file mode 100644 index 0000000..d9501a1 --- /dev/null +++ b/home-manager/neovim/copilot.lua @@ -0,0 +1,6 @@ +require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, +}) + +require('copilot_cmp').setup({}) diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index fdba23b..04bcc32 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -148,6 +148,10 @@ in # debugging nvim-dap nvim-dap-ui + + # copilot + copilot-lua + copilot-cmp ]; extraConfig = '' @@ -185,6 +189,8 @@ in vim.g.gitblame_date_format = "%r" + ${builtins.readFile ./copilot.lua } + EOF ''; }; diff --git a/home-manager/neovim/nvim-cmp.lua b/home-manager/neovim/nvim-cmp.lua index 7b0f78b..7392fe7 100644 --- a/home-manager/neovim/nvim-cmp.lua +++ b/home-manager/neovim/nvim-cmp.lua @@ -15,6 +15,7 @@ cmp.setup({ end }, sources = cmp.config.sources({ + { name = "copilot" }, { name = "nvim_lsp" }, { name = "nvim_lsp_signature_help" }, { name = "luasnip" }, @@ -59,6 +60,7 @@ cmp.setup({ fields = { "menu", "abbr", "kind" }, format = function(entry, item) local menu_icon = { + copilot = "", nvim_lsp = "λ", luasnip = "⋗", buffer = "Ω",