format lua files

This commit is contained in:
2025-04-09 22:22:12 +02:00
parent 584ad307d6
commit 2b21ea5e4e
20 changed files with 213 additions and 226 deletions

View File

@ -99,7 +99,7 @@ return {
window = {
documentation = {
winhighlight = 'Normal:CmpDocumentation'
winhighlight = 'Normal:CmpDocumentation',
},
completion = {
winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu,Search:None',
@ -111,8 +111,7 @@ return {
fields = { 'kind', 'abbr', 'menu' },
expandable_indicator = false,
format = function(entry, vim_item)
local kind = require('lspkind').cmp_format({ mode = 'symbol_text', maxwidth = 50, show_labelDetails = true })(
entry, vim_item)
local kind = require('lspkind').cmp_format({ mode = 'symbol_text', maxwidth = 50, show_labelDetails = true })(entry, vim_item)
local strings = vim.split(kind.kind, '%s', { trimempty = true })
kind.kind = ' ' .. (strings[1] or '') .. ' '
kind.menu = ' (' .. (strings[2] or '') .. ')'
@ -130,19 +129,19 @@ return {
{ name = 'cmdline_history' },
{ name = 'path' },
{ name = 'buffer' },
}
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'cmdline', priority = 200 },
{ name = 'path', priority = 3 },
{ name = 'cmdline', priority = 200 },
{ name = 'path', priority = 3 },
{ name = 'cmdline_history', priority = 3 },
{ name = 'buffer', priority = 3 }
{ name = 'buffer', priority = 3 },
},
matching = { disallow_symbol_nonprefix_matching = false }
matching = { disallow_symbol_nonprefix_matching = false },
})
end
end,
}