mirror of
https://github.com/tomru/vim.git
synced 2026-03-02 22:17:17 +01:00
add lspkind to nvim-cmp
This commit is contained in:
10
init.lua
10
init.lua
@@ -93,7 +93,7 @@ require('lazy').setup({
|
||||
|
||||
{ -- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
|
||||
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'onsails/lspkind.nvim' },
|
||||
},
|
||||
|
||||
-- Useful plugin to show you pending keybinds.
|
||||
@@ -461,10 +461,18 @@ mason_lspconfig.setup_handlers {
|
||||
-- nvim-cmp setup
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
local lspkind = require 'lspkind'
|
||||
|
||||
luasnip.config.setup {}
|
||||
|
||||
cmp.setup {
|
||||
formatting = {
|
||||
format = lspkind.cmp_format {
|
||||
mode = 'symbol',
|
||||
maxwidth = 100,
|
||||
ellipsis_char = '...',
|
||||
},
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
|
||||
Reference in New Issue
Block a user