From 9654f7d095778d28f2b6c3fdbab70ef79e3eb051 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 19 Oct 2021 23:05:51 +0100 Subject: [PATCH] feat(nvim): add cmp formatting --- nvim/.config/nvim/lua/opdavies/plugins/completion.lua | 10 ++++++++++ nvim/.config/nvim/plugins.vim | 1 + 2 files changed, 11 insertions(+) diff --git a/nvim/.config/nvim/lua/opdavies/plugins/completion.lua b/nvim/.config/nvim/lua/opdavies/plugins/completion.lua index 71f77ee..3d54da1 100644 --- a/nvim/.config/nvim/lua/opdavies/plugins/completion.lua +++ b/nvim/.config/nvim/lua/opdavies/plugins/completion.lua @@ -32,4 +32,14 @@ cmp.setup { { name = "luasnip" }, { name = "cmp_tabnine" }, }, + + formatting = { + format = require("lspkind").cmp_format({with_text = true, menu = ({ + buffer = "[buf]", + luasnip = "[snip]", + nvim_lsp = "[lsp]", + nvim_lua = "[lua]", + path = "[path]", + })}), + }, } diff --git a/nvim/.config/nvim/plugins.vim b/nvim/.config/nvim/plugins.vim index 935abca..55c3dfd 100644 --- a/nvim/.config/nvim/plugins.vim +++ b/nvim/.config/nvim/plugins.vim @@ -35,6 +35,7 @@ Plug 'hrsh7th/cmp-buffer' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-path' Plug 'hrsh7th/nvim-cmp' +Plug 'onsails/lspkind-nvim' Plug 'saadparwaiz1/cmp_luasnip' Plug 'tzachar/cmp-tabnine', { 'do': './install.sh' }