feat(plugin): Add nvim-aputopairs, use symbols in cmp
This commit is contained in:
parent
e6c9d72c3f
commit
3777f30d68
3 changed files with 10 additions and 1 deletions
nvim/plugin
|
@ -4,6 +4,7 @@ end
|
|||
vim.g.did_load_completion_plugin = true
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local lspkind = require('lspkind')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
|
@ -31,10 +32,12 @@ cmp.setup {
|
|||
},
|
||||
formatting = {
|
||||
format = lspkind.cmp_format {
|
||||
mode = 'symbol_text',
|
||||
-- mode = 'symbol_text',
|
||||
mode = 'symbol',
|
||||
with_text = true,
|
||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
-- show_labelDetails = true, -- show labelDetails in menu. Disabled by default
|
||||
|
||||
menu = {
|
||||
buffer = '[BUF]',
|
||||
|
@ -52,6 +55,10 @@ cmp.setup {
|
|||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
-- cmp.event:on(
|
||||
-- 'confirm_done',
|
||||
-- cmp_autopairs.on_confirm_done()
|
||||
-- ),
|
||||
mapping = {
|
||||
['<C-b>'] = cmp.mapping(function(_)
|
||||
if cmp.visible() then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue