mirror of https://gitlab.com/baco/dotconf.git
Configure lspkind for the only completion provider available
Since lspkind is now being used by just one completion provider (the only one remaining) the configuration is now taking place when loading such provider.
This commit is contained in:
parent
ccf9cb2451
commit
d10510cb99
|
@ -37,6 +37,9 @@ EOF
|
|||
|
||||
lua << EOF
|
||||
local nvim_lsp = require('lspconfig')
|
||||
-- lspkind-nvim
|
||||
cmp_format = require('lspkind').cmp_format({with_text=false, preset='codicons',
|
||||
menu=({nvim_lsp = "[LSP]", buffer = "[Buffer]", path = "[Path]"})})
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_command('autocmd CursorHoldI <buffer> lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false})')
|
||||
|
@ -48,6 +51,7 @@ local on_attach = function(client, bufnr)
|
|||
}
|
||||
)
|
||||
require('cmp').setup({
|
||||
formatting = {format = cmp_format},
|
||||
sources = {{name = 'nvim_lsp'}, {name = 'buffer'}, {name = 'path'}},
|
||||
})
|
||||
lsp_mappings()
|
||||
|
@ -72,6 +76,3 @@ autocmd FileType gitcommit lua require'cmp'.setup.buffer {
|
|||
\ { name = 'path' },
|
||||
\ },
|
||||
\ }
|
||||
|
||||
" lspkind-nvim
|
||||
lua require('lspkind').init({with_text=false, preset='codicons'})
|
||||
|
|
Loading…
Reference in New Issue