mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
working config for cmp-omni and vimtex
This commit is contained in:
parent
311768ce72
commit
4dd1350f25
@ -1,19 +1,2 @@
|
|||||||
local cmp = require('cmp')
|
|
||||||
cmp.setup.buffer {
|
|
||||||
formatting = {
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
vim_item.menu = ({
|
|
||||||
omni = (vim.inspect(vim_item.menu):gsub('%"', "")),
|
|
||||||
buffer = "[Buffer]",
|
|
||||||
})[entry.source.name]
|
|
||||||
return vim_item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'buffer' },
|
|
||||||
{ name = 'omni',},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.o.textwidth = 120
|
vim.o.textwidth = 120
|
||||||
vim.o.wrap = true
|
vim.o.wrap = true
|
||||||
|
|||||||
@ -35,6 +35,7 @@ cmp.setup({
|
|||||||
{ name = 'nvim_lua' }, -- for nvim lua function
|
{ name = 'nvim_lua' }, -- for nvim lua function
|
||||||
{ name = 'path' }, -- for path completion
|
{ name = 'path' }, -- for path completion
|
||||||
{ name = 'buffer', keyword_length = 4 }, -- for buffer word completion
|
{ name = 'buffer', keyword_length = 4 }, -- for buffer word completion
|
||||||
|
{ name = 'omni' },
|
||||||
{ name = 'emoji', insert = true, } -- emoji completion
|
{ name = 'emoji', insert = true, } -- emoji completion
|
||||||
},
|
},
|
||||||
completion = {
|
completion = {
|
||||||
@ -47,14 +48,15 @@ cmp.setup({
|
|||||||
formatting = {
|
formatting = {
|
||||||
format = lspkind.cmp_format({
|
format = lspkind.cmp_format({
|
||||||
mode = "symbol_text",
|
mode = "symbol_text",
|
||||||
menu = {
|
menu = ({
|
||||||
nvim_lsp = "[LSP]",
|
nvim_lsp = "[LSP]",
|
||||||
ultisnips = "[US]",
|
ultisnips = "[US]",
|
||||||
nvim_lua = "[Lua]",
|
nvim_lua = "[Lua]",
|
||||||
path = "[Path]",
|
path = "[Path]",
|
||||||
buffer = "[Buffer]",
|
buffer = "[Buffer]",
|
||||||
emoji = "[Emoji]",
|
emoji = "[Emoji]",
|
||||||
},
|
omni = "[Omni]",
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user