diff --git a/init.lua b/init.lua index 18517958..542bde7a 100644 --- a/init.lua +++ b/init.lua @@ -331,6 +331,7 @@ mason_lspconfig.setup_handlers { -- [[ Configure nvim-cmp ]] -- See `:help cmp` local cmp = require 'cmp' +local lspkind = require('lspkind') local luasnip = require 'luasnip' require('luasnip.loaders.from_vscode').lazy_load() luasnip.config.setup {} @@ -374,7 +375,19 @@ cmp.setup { { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'conjure' }, + { name = 'buffer' } }, + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol_text', + menu = ({ + buffer = "[Buffer]", + conjure = "[Conjure]", + nvim_lsp = "[LSP]", + luasnip = "[LuaSnip]" + }) + }) + } } -- The line beneath this is called `modeline`. See `:help modeline` diff --git a/lua/custom/plugins/autocomp.lua b/lua/custom/plugins/autocomp.lua index dd92ea58..24efedc0 100644 --- a/lua/custom/plugins/autocomp.lua +++ b/lua/custom/plugins/autocomp.lua @@ -9,10 +9,16 @@ return { -- Adds LSP completion capabilities 'hrsh7th/cmp-nvim-lsp', + -- Adds buffer context + 'hrsh7th/cmp-buffer', + -- Adds Conjure cmp 'PaterJason/cmp-conjure', -- Adds a number of user-friendly snippets 'rafamadriz/friendly-snippets', + + -- lspkind formatting + 'onsails/lspkind.nvim' }, }