From 13105bbe3a3d89f09976478ced6c1554ae9ec07e Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Tue, 23 Aug 2022 08:03:33 +0200 Subject: [PATCH] feat(neovim): style completion windows --- home-manager/neovim/nvim-cmp.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/home-manager/neovim/nvim-cmp.lua b/home-manager/neovim/nvim-cmp.lua index 9661507..7b0f78b 100644 --- a/home-manager/neovim/nvim-cmp.lua +++ b/home-manager/neovim/nvim-cmp.lua @@ -50,7 +50,25 @@ cmp.setup({ end end, { "i", "s" }), }), - experimental = { ghost_text = true } + experimental = { ghost_text = true }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + formatting = { + fields = { "menu", "abbr", "kind" }, + format = function(entry, item) + local menu_icon = { + nvim_lsp = "λ", + luasnip = "⋗", + buffer = "Ω", + path = "🖿", + } + + item.menu = menu_icon[entry.source.name] + return item + end, + }, }) -- `/` cmdline setup.