mirror of
https://github.com/marianozunino/nvim.git
synced 2025-06-28 02:23:50 -03:00
dev: automated commit - 2025-05-29 12:31:16
This commit is contained in:
parent
42ce37c7a1
commit
249a24b851
3 changed files with 59 additions and 28 deletions
|
@ -1,6 +1,9 @@
|
||||||
{
|
{
|
||||||
"diagnostics.globals": [
|
"diagnostics.globals": [
|
||||||
"Snacks"
|
"Snacks"
|
||||||
|
],
|
||||||
|
"diagnostics.disable": [
|
||||||
|
"duplicate-set-field"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,30 +10,6 @@ local M = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local servers = {
|
|
||||||
"gopls",
|
|
||||||
"jsonls",
|
|
||||||
"lua_ls",
|
|
||||||
"yamlls",
|
|
||||||
"graphql",
|
|
||||||
"html",
|
|
||||||
"omnisharp",
|
|
||||||
"svelte",
|
|
||||||
"vtsls",
|
|
||||||
"ccls",
|
|
||||||
"templ",
|
|
||||||
}
|
|
||||||
|
|
||||||
local tools = {
|
|
||||||
"prettierd",
|
|
||||||
"shfmt",
|
|
||||||
"stylua",
|
|
||||||
"latexindent",
|
|
||||||
"clang-format",
|
|
||||||
"csharpier",
|
|
||||||
"quick-lint-js",
|
|
||||||
}
|
|
||||||
|
|
||||||
local function setup_keymaps(bufnr)
|
local function setup_keymaps(bufnr)
|
||||||
local fzf = require("fzf-lua")
|
local fzf = require("fzf-lua")
|
||||||
local opts = { buffer = bufnr }
|
local opts = { buffer = bufnr }
|
||||||
|
@ -59,7 +35,20 @@ local function setup_keymaps(bufnr)
|
||||||
nmap("<leader>ws", fzf.lsp_workspace_symbols, vim.tbl_extend("force", opts, { desc = "Workspace Symbols" }))
|
nmap("<leader>ws", fzf.lsp_workspace_symbols, vim.tbl_extend("force", opts, { desc = "Workspace Symbols" }))
|
||||||
|
|
||||||
-- LSP management
|
-- LSP management
|
||||||
nmap("<leader>lr", ":LspRestart<CR>", vim.tbl_extend("force", opts, { desc = "Restart LSP" }))
|
nmap("<leader>lr", function()
|
||||||
|
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||||
|
if #clients == 0 then
|
||||||
|
vim.notify("No LSP clients attached to buffer", vim.log.levels.WARN)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local client_names = {}
|
||||||
|
for _, client in ipairs(clients) do
|
||||||
|
table.insert(client_names, client.name)
|
||||||
|
vim.cmd("LspRestart " .. client.name)
|
||||||
|
end
|
||||||
|
vim.notify("Restarted LSP clients: " .. table.concat(client_names, ", "), vim.log.levels.INFO)
|
||||||
|
end, vim.tbl_extend("force", opts, { desc = "Restart LSP" }))
|
||||||
nmap("<leader>li", ":LspInfo<CR>", vim.tbl_extend("force", opts, { desc = "LSP Info" }))
|
nmap("<leader>li", ":LspInfo<CR>", vim.tbl_extend("force", opts, { desc = "LSP Info" }))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -67,6 +56,15 @@ function M.config()
|
||||||
require("mason").setup({ max_concurrent_installers = 4 })
|
require("mason").setup({ max_concurrent_installers = 4 })
|
||||||
require("fidget").setup({})
|
require("fidget").setup({})
|
||||||
|
|
||||||
|
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||||
|
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.border = opts.border or "rounded"
|
||||||
|
opts.max_width = opts.max_width or 80
|
||||||
|
opts.max_height = opts.max_height or 20
|
||||||
|
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||||
|
end
|
||||||
|
|
||||||
-- Diagnostics
|
-- Diagnostics
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = { spacing = 2, source = "if_many" },
|
virtual_text = { spacing = 2, source = "if_many" },
|
||||||
|
@ -82,10 +80,36 @@ function M.config()
|
||||||
} or {},
|
} or {},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Mason setup
|
local servers = {
|
||||||
local mason_servers = vim.tbl_filter(function(s)
|
"gopls",
|
||||||
return s ~= "ccls"
|
"jsonls",
|
||||||
|
"lua_ls",
|
||||||
|
"yamlls",
|
||||||
|
"graphql",
|
||||||
|
"html",
|
||||||
|
"omnisharp",
|
||||||
|
"svelte",
|
||||||
|
"vtsls",
|
||||||
|
"ccls",
|
||||||
|
"templ",
|
||||||
|
}
|
||||||
|
|
||||||
|
local tools = {
|
||||||
|
"prettierd",
|
||||||
|
"shfmt",
|
||||||
|
"stylua",
|
||||||
|
"latexindent",
|
||||||
|
"clang-format",
|
||||||
|
"csharpier",
|
||||||
|
"quick-lint-js",
|
||||||
|
}
|
||||||
|
|
||||||
|
local mason_unsupported = { "ccls" }
|
||||||
|
|
||||||
|
local mason_servers = vim.tbl_filter(function(server)
|
||||||
|
return not vim.tbl_contains(mason_unsupported, server)
|
||||||
end, servers)
|
end, servers)
|
||||||
|
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = mason_servers,
|
ensure_installed = mason_servers,
|
||||||
automatic_installation = true,
|
automatic_installation = true,
|
||||||
|
|
|
@ -36,6 +36,10 @@ return {
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
select = {
|
||||||
|
enabled = true,
|
||||||
|
win = { border = "rounded" },
|
||||||
|
},
|
||||||
debug = { enabled = true },
|
debug = { enabled = true },
|
||||||
image = { enabled = true },
|
image = { enabled = true },
|
||||||
indent = { enabled = true, animate = { enabled = false } },
|
indent = { enabled = true, animate = { enabled = false } },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue