Nvim: Update all plugins

This commit is contained in:
Robert Kmieć
2025-04-23 01:37:19 +02:00
parent 43e7fb01f5
commit c665c5ba37
16 changed files with 268 additions and 162 deletions

View File

@@ -1,45 +1,44 @@
return {
'neovim/nvim-lspconfig',
dependencies = {
-- "SmiteshP/nvim-navbuddy",
"jubnzv/virtual-types.nvim",
--"ray-x/lsp_signature.nvim",
'sontungexpt/better-diagnostic-virtual-text',
{url = "http://git.sr.ht/~p00f/clangd_extensions.nvim"},
-- "jubnzv/virtual-types.nvim",
-- "ray-x/lsp_signature.nvim",
-- 'sontungexpt/better-diagnostic-virtual-text',
{ url = "http://git.sr.ht/~p00f/clangd_extensions.nvim" },
},
config = function()
local nvim_lsp = require('lspconfig')
require('clangd_extensions').setup({
ast = {
-- These are unicode, should be available in any font
role_icons = {
type = "🄣",
declaration = "🄓",
expression = "🄔",
statement = ";",
specifier = "🄢",
["template argument"] = "🆃",
},
kind_icons = {
Compound = "🄲",
Recovery = "🅁",
TranslationUnit = "🅄",
PackExpansion = "🄿",
TemplateTypeParm = "🅃",
TemplateTemplateParm = "🅃",
TemplateParamObject = "🅃",
},
highlights = {
detail = "Comment",
},
memory_usage = {
border = "none",
},
symbol_info = {
border = "none",
}
-- These are unicode, should be available in any font
role_icons = {
type = "🄣",
declaration = "🄓",
expression = "🄔",
statement = ";",
specifier = "🄢",
["template argument"] = "🆃",
},
kind_icons = {
Compound = "🄲",
Recovery = "🅁",
TranslationUnit = "🅄",
PackExpansion = "🄿",
TemplateTypeParm = "🅃",
TemplateTemplateParm = "🅃",
TemplateParamObject = "🅃",
},
highlights = {
detail = "Comment",
},
memory_usage = {
border = "none",
},
symbol_info = {
border = "none",
}
}
})
--local lsp_signature = require('lsp_signature')
@@ -58,53 +57,61 @@ return {
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
-- vim.keymap.del("n", "gra", opts)
-- vim.keymap.del("v", "gra", opts)
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
--def vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
--vim.keymap.del("n", "grr", opts)
--def vim.keymap.set('n', 'gri', vim.lsp.buf.implementation, opts)
--def vim.keymap.set('n', 'gO', vim.lsp.buf.document_symbol, opts)
--def vim.keymap.set('n', 'grn', vim.lsp.buf.rename, opts)
--vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
--vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
--vim.keymap.set('n', '<space>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<F6>', '<cmd>ClangdSwitchSourceHeader<CR>', opts)
vim.keymap.set("n", "<leader>q", function() vim.lsp.buf.format{ async = true } end, opts)
vim.keymap.set("n", "<leader>q", function() vim.lsp.buf.format { async = true } end, opts)
require'virtualtypes'.on_attach()
-- require 'virtualtypes'.on_attach()
-- require'lsp_signature'.on_attach({
-- floating_window = true,
-- floating_window_above_cur_line = true,
-- floating_window_off_x = 10,
-- floating_window_off_y = 0,
-- })
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
},
priority = 2003, -- the priority of virtual text
inline = true})
-- 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
-- },
-- priority = 2003, -- the priority of virtual text
-- inline = true
-- })
vim.diagnostic.config({
underline = false,
signs = {
text = {
[vim.diagnostic.severity.HINT] = "",
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.WARN] = ""
vim.diagnostic.config({
underline = false,
signs = {
text = {
[vim.diagnostic.severity.HINT] = "",
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.WARN] = ""
}
},
virtual_text = false,
update_in_insert = false,
severity_sort = true,
virtual_lines = {
current_line = true,
}
},
virtual_text = true,
update_in_insert = false,
severity_sort = true
})
end
})
end
})
--local capabilities = vim.lsp.protocol.make_client_capabilities()
@@ -140,6 +147,7 @@ return {
nvim_lsp.lua_ls.setup({
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
completion = {
callSnippet = "Replace"
}
@@ -147,22 +155,23 @@ return {
}
})
nvim_lsp.matlab_ls.setup({
cmd = { "matlab-language-server", "--stdio"},
filetypes = { "matlab" },
-- 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 = {
indexWorkspace = false,
installPath = "/usr/local/MATLAB/R2022b",
matlabConnectionTiming = "onStart",
telemetry = true,
},
}
})
-- nvim_lsp.matlab_ls.setup({
-- cmd = { "matlab-language-server", "--stdio" },
-- filetypes = { "matlab" },
-- -- 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 = {
-- indexWorkspace = false,
-- installPath = "/usr/local/MATLAB/R2024b",
-- matlabConnectionTiming = "onStart",
-- telemetry = true,
-- },
-- }
-- })
--
nvim_lsp.typos_lsp.setup({
cmd = { 'typos-lsp' },
filetypes = { '*' },