Files
Dukantic_Setup/config/nvim/lua/config/lsp.lua
2025-11-12 17:19:04 +01:00

53 lines
1.6 KiB
Lua

require("mason-lspconfig").setup({
ensure_installed = {
"rust_analyzer", -- Rust
"clangd", -- C/C++
"pyright", -- Python
"html", -- HTML
"cssls", -- CSS
"ts_ls", -- JavaScript/TypeScript
"emmet_ls", -- Emmet support (verify availability)
"marksman", -- Markdown
"lua_ls", -- Lua
},automatic_enable = true,
})
-- Configure Mason null-ls tools (formatters and linters)
require("mason-null-ls").setup({
ensure_installed = {
"clippy", -- Rust linter
"clang-format", -- C/C++ formatter
"cpplint", -- C++ linter
"black", -- Python formatter
"flake8", -- Python linter
"isort", -- Python import sorter
"prettier", -- JS/HTML/CSS/MD formatter
"eslint_d", -- JS linter
"stylelint", -- CSS linter
"markdownlint" -- Markdown linter
},
automatic_setup = true,
})
-- Configure Treesitter for better syntax highlighting
require("nvim-treesitter.configs").setup({
ensure_installed = {
"rust", "java", "c", "cpp", "python",
"html", "css", "javascript", "typescript",
"markdown", "lua"
},
highlight = { enable = true },
})
vim.diagnostic.config({
virtual_text = {
prefix = '', -- Could be '■', '▎', '●' or 'none'
spacing = 4,
},
signs = true, -- Show signs in the gutter
underline = true, -- Underline the problematic code
update_in_insert = false, -- Do not update diagnostics while in insert mode
severity_sort = true, -- Sort diagnostics by severity
})