mirror of
https://git.aramjonghu.nl/AramJonghu/nvim.git
synced 2026-03-22 09:41:10 +01:00
71 lines
2.0 KiB
Lua
71 lines
2.0 KiB
Lua
local mason = require("mason")
|
|
local mason_lspconfig = require("mason-lspconfig")
|
|
local lspconfig = require("lspconfig")
|
|
local cmp_cap = require("config.cmp").capabilities
|
|
|
|
mason.setup()
|
|
|
|
mason_lspconfig.setup({
|
|
ensure_installed = {
|
|
"rust_analyzer", "jdtls", "yamlls", "ts_ls", "tailwindcss", "html",
|
|
"cssls"
|
|
},
|
|
handlers = {
|
|
function(server_name)
|
|
lspconfig[server_name].setup({capabilities = cmp_cap})
|
|
end,
|
|
zls = function()
|
|
lspconfig.zls.setup({
|
|
capabilities = cmp_cap,
|
|
root_dir = lspconfig.util.root_pattern(".git", "build.zig",
|
|
"zls.json"),
|
|
settings = {
|
|
zls = {
|
|
enable_inlay_hints = true,
|
|
enable_snippets = true,
|
|
warn_style = true
|
|
}
|
|
}
|
|
})
|
|
vim.g.zig_fmt_parse_errors = 0
|
|
vim.g.zig_fmt_autosave = 0
|
|
end
|
|
}
|
|
})
|
|
|
|
lspconfig.lua_ls.setup({
|
|
capabilities = cmp_cap,
|
|
settings = {
|
|
Lua = {
|
|
runtime = {version = "LuaJIT"},
|
|
diagnostics = {
|
|
globals = {
|
|
"vim", "bit", "it", "describe", "before_each", "after_each"
|
|
}
|
|
},
|
|
workspace = {
|
|
checkThirdParty = false,
|
|
library = {vim.env.VIMRUNTIME}
|
|
},
|
|
telemetry = {enable = false}
|
|
}
|
|
}
|
|
})
|
|
|
|
vim.diagnostic.config({
|
|
virtual_text = true,
|
|
float = {
|
|
focusable = false,
|
|
style = "minimal",
|
|
border = "rounded",
|
|
source = "always",
|
|
header = "",
|
|
prefix = ""
|
|
}
|
|
})
|
|
|
|
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>",
|
|
{noremap = true, silent = true})
|
|
vim.api.nvim_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>",
|
|
{noremap = true, silent = true})
|