format cmp file

This commit is contained in:
Oliver Hartmann 2024-07-09 00:15:33 +02:00
parent 8b58c302c1
commit 2554ed57cb

View File

@ -93,7 +93,7 @@ return {
end, end,
}, },
sources = { sources = {
{ name = 'luasnip', priority = 8 }, { name = 'luasnip', priority = 8 },
{ {
name = 'nvim_lsp', name = 'nvim_lsp',
option = { option = {
@ -137,9 +137,9 @@ return {
}, },
enabled = function() enabled = function()
return vim.api.nvim_get_option_value('buftype', { buf = 0 }) ~= 'prompt' return vim.api.nvim_get_option_value('buftype', { buf = 0 }) ~= 'prompt'
or vim.api.nvim_get_option_value('filetype', { buf = 0 }) == 'dap-repl' or vim.api.nvim_get_option_value('filetype', { buf = 0 }) == 'dap-repl'
or vim.api.nvim_get_option_value('filetype', { buf = 0 }) == 'dapui_watches' or vim.api.nvim_get_option_value('filetype', { buf = 0 }) == 'dapui_watches'
or vim.api.nvim_get_option_value('filetype', { buf = 0 }) == 'dapui_hover' or vim.api.nvim_get_option_value('filetype', { buf = 0 }) == 'dapui_hover'
end, end,
-- completion = { -- completion = {
-- completeopt = 'menu,menuone,noinsert, noselect', -- completeopt = 'menu,menuone,noinsert, noselect',
@ -160,8 +160,9 @@ return {
format = function(entry, vim_item) format = function(entry, vim_item)
local kind = require('lspkind').cmp_format({ local kind = require('lspkind').cmp_format({
mode = 'symbol', mode = 'symbol',
symbol_map = { Codeium = "", }, symbol_map = { Codeium = '' },
maxwidth = 50 })(entry, vim_item) maxwidth = 50,
})(entry, vim_item)
local strings = vim.split(kind.kind, '%s', { trimempty = true }) local strings = vim.split(kind.kind, '%s', { trimempty = true })
kind.kind = ' ' .. (strings[1] or '') .. ' ' kind.kind = ' ' .. (strings[1] or '') .. ' '
return kind return kind