From 789d83ef1442306b027743db9f8aef727ea340e6 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 5 Jan 2025 17:46:29 +0900 Subject: [PATCH] feat(neovim): add blink-cmp-copilot --- .../neovim-with-config/lua/plugins/completion.lua | 15 +++++++++++++++ pkgs/neovim-with-config/plugins.nix | 4 +--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/neovim-with-config/lua/plugins/completion.lua b/pkgs/neovim-with-config/lua/plugins/completion.lua index 32f52bfe..7e7b73fe 100644 --- a/pkgs/neovim-with-config/lua/plugins/completion.lua +++ b/pkgs/neovim-with-config/lua/plugins/completion.lua @@ -18,6 +18,17 @@ return { }, }, signature = { enabled = true }, + sources = { + default = { "lsp", "path", "snippets", "buffer", "copilot" }, + providers = { + copilot = { + name = "copilot", + module = "blink-cmp-copilot", + score_offset = 100, + async = true, + }, + }, + }, }) end, }, @@ -32,4 +43,8 @@ return { }) end, }, + { + "blink-cmp-copilot", + event = "InsertEnter", + }, } diff --git a/pkgs/neovim-with-config/plugins.nix b/pkgs/neovim-with-config/plugins.nix index 9e7a7e38..fb9a3386 100644 --- a/pkgs/neovim-with-config/plugins.nix +++ b/pkgs/neovim-with-config/plugins.nix @@ -12,6 +12,7 @@ pluginsWithLazy true [ ChatGPT-nvim FixCursorHold-nvim blink-cmp + blink-cmp-copilot bufferline-nvim comment-nvim copilot-lua @@ -60,7 +61,4 @@ pluginsWithLazy true [ ++ (pluginsWithLazy false [ lz-n nvim-web-devicons - # don't make nvim-cmp related packages lazy loading - # https://github.com/nvim-neorocks/lz.n/wiki/lazy%E2%80%90loading-nvim%E2%80%90cmp-and-its-extensions - copilot-cmp ])