Nvim: use blink instead of cmp

This commit is contained in:
Robert Kmieć
2025-01-10 11:10:51 +01:00
parent f6ecd9592c
commit 4ebfe540ad
25 changed files with 1134 additions and 762 deletions

View File

@@ -22,7 +22,7 @@ return {
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = { "CursorMoved" },
only_current_line_autocmd = { "CursorMoved", "CursorMovedI" },
-- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true,
-- prefix for parameter hints
@@ -30,7 +30,7 @@ return {
-- prefix for all the other hints (type, chaining)
other_hints_prefix = "",
-- whether to align to the length of the longest line in the file
max_len_align = false,
max_len_align = true,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
@@ -61,25 +61,6 @@ return {
TemplateTemplateParm = "🅃",
TemplateParamObject = "🅃",
},
--[[ These require codicons (https://github.com/microsoft/vscode-codicons)
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
}, ]]
highlights = {
detail = "Comment",
},
@@ -127,41 +108,37 @@ return {
-- })
require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints()
require("better-diagnostic-virtual-text.api").setup_buf(ev.buf, {})
local signs = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "" },
{ name = "DiagnosticSignInfo", text = "" },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
end
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
signs = false,
severity_sort = true,
underline = true,
update_in_insert = false,
virtual_text = {
spacing = 30,
require("better-diagnostic-virtual-text.api").setup_buf(ev.buf, {
ui = {
wrap_line_after = false, -- wrap the line after this length to avoid the virtual text is too long
left_kept_space = 3, --- the number of spaces kept on the left side of the virtual text, make sure it enough to custom for each line
right_kept_space = 3, --- the number of spaces kept on the right side of the virtual text, make sure it enough to custom for each line
arrow = "",
up_arrow = "",
down_arrow = "",
above = false, -- the virtual text will be displayed above the line
},
float = true
}
)
priority = 2003, -- the priority of virtual text
inline = true})
vim.diagnostic.config({
underline = false,
signs = true,
virtual_text = true,
update_in_insert = false,
severity_sort = true
})
end
})
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
local capabilities = require('cmp_nvim_lsp').default_capabilities()
--local capabilities = vim.lsp.protocol.make_client_capabilities()
--local capabilities = require('cmp_nvim_lsp').default_capabilities()
local capabilities = require('blink.cmp').get_lsp_capabilities()
-- local capabilities = vim.tbl_deep_extend('force',
-- vim.lsp.protocol.make_client_capabilities(),
-- require('epo').register_cap()
-- )
capabilities.offsetEncoding = { "utf-16" }
--capabilities.offsetEncoding = { "utf-16" }
nvim_lsp.groovyls.setup({
cmd = { "java", "-jar", "/home/kmcr/tools/groovy-language-server/build/libs/groovy-language-server-all.jar" },
@@ -197,7 +174,8 @@ return {
nvim_lsp.matlab_ls.setup({
cmd = { "matlab-language-server", "--stdio"},
filetypes = { "matlab" },
root_dir = nvim_lsp.util.find_git_ancestor,
-- root_dir = nvim_lsp.util.find_git_ancestor,
root_dir = vim.fs.dirname(vim.fs.find('.git', { path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), upward = true })[1]),
single_file_support = true,
settings = {
matlab = {