From e1c7c4b02ff7443ea719dd1998966c20846d97f8 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Mon, 21 Nov 2022 21:08:54 +0100 Subject: [PATCH] chore(nvim): add nvim-cmp plugin --- nvim/after/plugin/cmp.lua | 39 +++-------------------------------- nvim/lua/kogakure/plugins.lua | 1 + 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/nvim/after/plugin/cmp.lua b/nvim/after/plugin/cmp.lua index d64012f..a4aa838 100644 --- a/nvim/after/plugin/cmp.lua +++ b/nvim/after/plugin/cmp.lua @@ -43,6 +43,7 @@ local kind_icons = { Event = "", Operator = "", TypeParameter = "", + Octoface = "", } -- find more here: https://www.nerdfonts.com/cheat-sheet @@ -98,12 +99,8 @@ cmp.setup({ -- Kind icons vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - if entry.source.name == "copilot" then - vim_item.kind = icons.git.Octoface - vim_item.kind_hl_group = "CmpItemKindCopilot" - end - -- vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind vim_item.menu = ({ + copilot = "[C]", nvim_lsp = "[LSP]", luasnip = "[Snippet]", buffer = "[Buffer]", @@ -118,37 +115,7 @@ cmp.setup({ end, }, sources = { - { - name = "copilot", - -- keyword_length = 0, - max_item_count = 3, - trigger_characters = { - { - ".", - ":", - "(", - "'", - '"', - "[", - ",", - "#", - "*", - "@", - "|", - "=", - "-", - "{", - "/", - "\\", - "+", - "?", - " ", - -- "\t", - -- "\n", - }, - }, - group_index = 2, - }, + { name = "copilot" }, { name = "nvim_lsp" }, { name = "nvim_lsp_signature_help" }, { name = "luasnip" }, diff --git a/nvim/lua/kogakure/plugins.lua b/nvim/lua/kogakure/plugins.lua index 512f23a..32505a1 100644 --- a/nvim/lua/kogakure/plugins.lua +++ b/nvim/lua/kogakure/plugins.lua @@ -59,6 +59,7 @@ return packer.startup(function(use) use("hrsh7th/cmp-path") -- Path completions use("hrsh7th/cmp-cmdline") -- Cmdline completions use("hrsh7th/cmp-nvim-lua") -- Lua API completions + use("hrsh7th/cmp-copilot") -- GitHub Copilot completions use("saadparwaiz1/cmp_luasnip") -- Snippet completions use("uga-rosa/cmp-dictionary") -- Dictionary completions use("f3fora/cmp-spell") -- Spell completions