Add formatting and some buffer context
This commit is contained in:
parent
fffc2e3d46
commit
6a34515c0e
13
init.lua
13
init.lua
|
@ -331,6 +331,7 @@ mason_lspconfig.setup_handlers {
|
||||||
-- [[ Configure nvim-cmp ]]
|
-- [[ Configure nvim-cmp ]]
|
||||||
-- See `:help cmp`
|
-- See `:help cmp`
|
||||||
local cmp = require 'cmp'
|
local cmp = require 'cmp'
|
||||||
|
local lspkind = require('lspkind')
|
||||||
local luasnip = require 'luasnip'
|
local luasnip = require 'luasnip'
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
luasnip.config.setup {}
|
luasnip.config.setup {}
|
||||||
|
@ -374,7 +375,19 @@ cmp.setup {
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
{ name = 'conjure' },
|
{ 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`
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
|
|
|
@ -9,10 +9,16 @@ return {
|
||||||
-- Adds LSP completion capabilities
|
-- Adds LSP completion capabilities
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
|
||||||
|
-- Adds buffer context
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
|
||||||
-- Adds Conjure cmp
|
-- Adds Conjure cmp
|
||||||
'PaterJason/cmp-conjure',
|
'PaterJason/cmp-conjure',
|
||||||
|
|
||||||
-- Adds a number of user-friendly snippets
|
-- Adds a number of user-friendly snippets
|
||||||
'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
|
|
||||||
|
-- lspkind formatting
|
||||||
|
'onsails/lspkind.nvim'
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue