Update 2025-04-30

Update 2025-04-04

Update 2025-04-06

Update 2025-04-11

Update 2025-04-13

Update 2025-04-14

Update 2025-04-15

Update 2025-04-25

Update 2025-04-27

Update 2025-04-30
This commit is contained in:
2025-04-16 16:25:22 +03:00
parent f9df29cfaa
commit 0c2ba155d4
17 changed files with 164 additions and 237 deletions

View File

@@ -10,6 +10,7 @@ return {
"piersolenski/telescope-import.nvim",
"mrcjkb/rustaceanvim",
"pmizio/typescript-tools.nvim",
"nvim-java/nvim-java",
},
config = function(_, opts)
require("mason").setup()
@@ -48,14 +49,13 @@ return {
nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
nmap("gd", vim.lsp.buf.definition, "[G]oto [D]efinition")
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
nmap("K", function()
vim.lsp.buf.hover({ border = "rounded" })
end, "Hover Documentation")
nmap("gi", vim.lsp.buf.implementation, "[G]oto [I]mplementation")
vim.keymap.set(
"i",
"<C-h>",
vim.lsp.buf.signature_help,
{ buffer = event.buf, desc = "LSP: Signature Documentation" }
)
vim.keymap.set("i", "<C-h>", function()
vim.lsp.buf.signature_help({ border = "rounded" })
end, { buffer = event.buf, desc = "LSP: Signature Documentation" })
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
nmap("<leader>ws", vim.lsp.buf.workspace_symbol, "[W]orkspace [S]ymbol")
@@ -65,14 +65,18 @@ return {
end, "[W]orkspace [L]ist Folders")
nmap("<leader>lD", vim.lsp.buf.type_definition, "Type [D]efinition")
nmap("<leader>lr", vim.lsp.buf.rename, "[R]ename")
nmap("<leader>lj", vim.diagnostic.goto_next, "Diagnostic Next")
nmap("<leader>lk", vim.diagnostic.goto_prev, "Diagnostic Prev")
nmap("]d", function()
trouble.next({ mode = "diagnostics", skip_groups = true, jump = true })
end, "LSP: Trouble Next")
nmap("[d", function()
trouble.prev({ mode = "diagnostics", skip_groups = true, jump = true })
end, "Trouble Prev")
nmap("<leader>lj", function()
vim.diagnostic.jump({ count = 1, float = true })
end, "Diagnostic Next")
nmap("<leader>lk", function()
vim.diagnostic.jump({ count = -1, float = true })
end, "Diagnostic Prev")
-- nmap("]d", function()
-- trouble.next({ mode = "diagnostics", skip_groups = true, jump = true })
-- end, "LSP: Trouble Next")
-- nmap("[d", function()
-- trouble.prev({ mode = "diagnostics", skip_groups = true, jump = true })
-- end, "Trouble Prev")
vim.keymap.set(
{ "n", "v" },
"<leader>la",
@@ -80,26 +84,22 @@ return {
{ buffer = event.buf, desc = "LSP: Code [A]ction" }
)
nmap("gr", function()
require("trouble").toggle("lsp_references")
trouble.toggle("lsp_references")
end, "[G]oto [R]eferences")
nmap("gR", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
end,
})
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.diagnostic.config({
virtual_text = true, -- virtual text
signs = { active = signs }, -- show signs
virtual_text = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.HINT] = "",
[vim.diagnostic.severity.INFO] = "",
},
},
update_in_insert = true,
underline = true,
severity_sort = true,
@@ -113,14 +113,6 @@ return {
},
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
})
require("mason-lspconfig").setup({
automatic_installation = true,
automatic_setup = true,
@@ -141,6 +133,9 @@ return {
handlers = {
default_setup,
ts_ls = function() end,
jdtls = function()
require("java").setup({})
end,
},
})
@@ -149,6 +144,19 @@ return {
config.capabilities = extend_capabilities(capabilities)
lspconfig[server].setup(config)
end
local function setup_ghostty_lsp()
-- Only activate ghostty-lsp when editing the ghostty config
if vim.fn.expand("%:p") == vim.fs.normalize("**/ghostty/config") then
vim.lsp.start({
name = "ghostty-lsp",
cmd = { "ghostty-lsp" },
root_dir = vim.fs.normalize("~/.config/ghostty"),
})
end
end
vim.api.nvim_create_autocmd("BufRead", { pattern = "*", callback = setup_ghostty_lsp })
end,
opts = {
@@ -175,7 +183,7 @@ return {
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim", "awesome", "client" },
globals = { "vim", "awesome", "client", "ya" },
},
-- workspace = {
-- Make the server aware of Neovim runtime files
@@ -313,15 +321,15 @@ return {
provideFormatter = false,
},
},
tinymist = {
offset_encoding = "utf-8",
settings = {
formatterMode = "typstyle",
exportPdf = "onSave",
outputPath = "$root/target/$dir/$name",
semanticTokens = "disable",
},
},
-- tinymist = {
-- offset_encoding = "utf-8",
-- settings = {
-- formatterMode = "typstyle",
-- exportPdf = "none",
-- outputPath = "$root/target/$dir/$name",
-- semanticTokens = "disable",
-- },
-- },
matlab_ls = {
indexWorkspace = true,
matlabConnectionTiming = "onStart",
@@ -331,6 +339,7 @@ return {
"octave",
},
},
jdtls = {},
},
},
}