diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-06-23 16:43:58 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-06-23 16:43:58 +0200 |
| commit | 655ea643e768ff19a39985d5a627074e6e7abea1 (patch) | |
| tree | 8f200fb46b343e723093c28e6ff1293ed835f9e8 | |
| parent | 739b2931a2ca1ab5eef9686311990e58d55e34a3 (diff) | |
| download | nvim-conf-655ea643e768ff19a39985d5a627074e6e7abea1.tar.gz nvim-conf-655ea643e768ff19a39985d5a627074e6e7abea1.zip | |
add copilot
| -rw-r--r-- | lazy-lock.json | 2 | ||||
| -rw-r--r-- | lua/alpha/completition/init.lua | 10 | ||||
| -rw-r--r-- | lua/plugins/completition.lua | 13 |
3 files changed, 22 insertions, 3 deletions
diff --git a/lazy-lock.json b/lazy-lock.json index d5f638e..ccb97ea 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -14,6 +14,8 @@ "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" }, "composer.nvim": { "branch": "main", "commit": "ec9537969adc7fc128cfe9c3a9925850455896c8" }, + "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, + "copilot.lua": { "branch": "master", "commit": "9cb5396205faf609bc9df0e841e133ccb1b70540" }, "dressing.nvim": { "branch": "master", "commit": "5fb5cce0cbfcedeadbcee43e5674e8c9a9f28d4a" }, "fzf": { "branch": "master", "commit": "01302d097c39c3429de65424c6adb75fcac82187" }, "fzf.vim": { "branch": "master", "commit": "1dcdb21db618055134cd611f4f5918f6d00a5df0" }, diff --git a/lua/alpha/completition/init.lua b/lua/alpha/completition/init.lua index 062622a..c511bac 100644 --- a/lua/alpha/completition/init.lua +++ b/lua/alpha/completition/init.lua @@ -36,10 +36,11 @@ cmp.setup { ["<c-space>"] = cmp.mapping.complete(), }, sources = { - { name = "nvim_lua" }, + { name = "nvim_lua", group_index = 2 }, { name = "nvim_lsp" }, { name = "path" }, - { name = "luasnip" }, + { name = "luasnip", group_index = 2 }, + { name = "copilot", group_index = 2 }, -- { name = "nvim_lsp_signature_help" }, { name = "buffer", @@ -49,7 +50,7 @@ cmp.setup { local bufs = {} for _, win in ipairs(vim.api.nvim_list_wins()) do local bufnr = vim.api.nvim_win_get_buf(win) - if vim.api.nvim_buf_get_option(bufnr, 'buftype') ~= 'terminal' then + if vim.api.nvim_buf_get_option(bufnr, "buftype") ~= "terminal" then bufs[bufnr] = true end end @@ -74,6 +75,7 @@ cmp.setup { nvim_lua = "[api]", path = "[path]", luasnip = "[snip]", + copilot = "[ﮧ ]", ["vim-dadbod-completion"] = "[DB]", }, }, @@ -94,6 +96,8 @@ cmp.setup { }, } +vim.api.nvim_set_hl(0, "CmpItemKindCopilot", {fg ="#6CC644"}) + -- Set configuration for specific filetype. cmp.setup.filetype("gitcommit", { sources = cmp.config.sources({ diff --git a/lua/plugins/completition.lua b/lua/plugins/completition.lua index 4e2c85d..b0c93d6 100644 --- a/lua/plugins/completition.lua +++ b/lua/plugins/completition.lua @@ -11,6 +11,19 @@ return { "onsails/lspkind-nvim", { "L3MON4D3/LuaSnip", version = "v1.*" }, "windwp/nvim-autopairs", + { + "zbirenbaum/copilot-cmp", + dependencies = { + "zbirenbaum/copilot.lua", + cmd = { "Copilot" }, + event = { "VeryLazy" }, + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + }, + }, + config = true, + }, -- "hrsh7th/cmp-nvim-lsp-signature-help", }, event = "VeryLazy", |