Add formatting and some buffer context

This commit is contained in:
mjhika 2023-09-07 11:25:08 -04:00
parent fffc2e3d46
commit 6a34515c0e
2 changed files with 19 additions and 0 deletions

View File

@ -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`

View File

@ -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'
},
}