modify cmp

This commit is contained in:
Javier Pacheco 2023-09-03 06:29:44 -05:00
parent 5a780ab55e
commit 75da7aacf5
1 changed files with 12 additions and 4 deletions

View File

@ -495,9 +495,17 @@ cmp.setup {
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'nvim_lsp', group_index = 1 },
{ name = 'luasnip', group_index = 2 },
{ name = 'path', group_index = 3 },
},
window = {
completion = require('cmp').config.window.bordered({
border = 'rounded',
}),
documentation = require('cmp').config.window.bordered({
border = 'rounded',
}),
},
formatting = {
-- changing the order of fields so the icon is the first
@ -522,7 +530,7 @@ cmp.setup {
function highlight_neorg_code_block()
local line = vim.fn.getline('.')
local lang = string.match(line, '^@code%s+(%S+)')
print('Detected language:', lang) -- Debug line
print('Detected language:', lang) -- Debug line
if lang then
vim.cmd('setlocal syntax=' .. lang)
end