aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home/.config/nvim/lua/plugins/lsp.lua
diff options
context:
space:
mode:
authorLibravatar sommerfeld <[email protected]>2026-04-17 10:53:11 +0100
committerLibravatar sommerfeld <[email protected]>2026-04-17 10:53:11 +0100
commitfcab70e06325f123030a9442aef001707a603950 (patch)
tree2bd9c2bd5c731767653f3e2f06adeaa54119eeb5 /home/.config/nvim/lua/plugins/lsp.lua
parentbf282a6e1c16a2976a8478f1f6ef916bcf75e52c (diff)
downloaddotfiles-fcab70e06325f123030a9442aef001707a603950.tar.gz
dotfiles-fcab70e06325f123030a9442aef001707a603950.tar.bz2
dotfiles-fcab70e06325f123030a9442aef001707a603950.zip
refactor: flatten custom/plugins/ to plugins/
Rename lua/custom/plugins/ to lua/plugins/ following the standard lazy.nvim convention. The extra custom/ nesting added no value. Update import path in init.lua accordingly.
Diffstat (limited to 'home/.config/nvim/lua/plugins/lsp.lua')
-rw-r--r--home/.config/nvim/lua/plugins/lsp.lua207
1 files changed, 207 insertions, 0 deletions
diff --git a/home/.config/nvim/lua/plugins/lsp.lua b/home/.config/nvim/lua/plugins/lsp.lua
new file mode 100644
index 0000000..585c285
--- /dev/null
+++ b/home/.config/nvim/lua/plugins/lsp.lua
@@ -0,0 +1,207 @@
+return {
+ {
+ "folke/lazydev.nvim",
+ ft = "lua",
+ opts = {
+ library = {
+ { path = "${3rd}/luv/library", words = { "vim%.uv" } },
+ },
+ },
+ },
+ {
+ "neovim/nvim-lspconfig",
+ version = false,
+ dependencies = {
+ { "j-hui/fidget.nvim", opts = {} },
+ "saghen/blink.cmp",
+ { "williamboman/mason.nvim", opts = {} },
+ {
+ "williamboman/mason-lspconfig.nvim",
+ opts = {
+ ensure_installed = {},
+ automatic_installation = false,
+ handlers = {
+ function(server_name)
+ vim.lsp.enable(server_name)
+ end,
+ },
+ },
+ },
+ {
+ "WhoIsSethDaniel/mason-tool-installer.nvim",
+ opts = {
+ ensure_installed = {
+ "actionlint",
+ "autotools-language-server",
+ "basedpyright",
+ "bash-language-server",
+ "clangd",
+ "codelldb",
+ "codespell",
+ "css-lsp",
+ "dockerfile-language-server",
+ "gh",
+ "gh-actions-language-server",
+ "groovy-language-server",
+ "hadolint",
+ "html-lsp",
+ "jq",
+ "json-lsp",
+ "jsonlint",
+ "just-lsp", -- "Platform unsupported"
+ "lua-language-server",
+ "markdownlint",
+ "mdformat",
+ "neocmakelsp",
+ "nginx-config-formatter",
+ "nginx-language-server", -- needs python <= 3.12
+ "npm-groovy-lint",
+ "prettier",
+ "ruff",
+ "rust-analyzer",
+ "shellcheck",
+ "shellharden",
+ "shfmt",
+ "stylelint",
+ "stylua",
+ "systemd-lsp",
+ "systemdlint",
+ "typescript-language-server",
+ "typos",
+ "yaml-language-server",
+ "yamllint",
+ "yq",
+ -- "fortls",
+ },
+ },
+ },
+ },
+ config = function()
+ vim.lsp.enable("just")
+ vim.lsp.enable("tblgen_lsp_server")
+ end,
+ },
+ {
+ "stevearc/conform.nvim",
+ event = { "BufWritePre" },
+ cmd = { "ConformInfo" },
+ keys = {
+ {
+ "<leader>f",
+ function()
+ require("conform").format({ async = true, lsp_fallback = true })
+ end,
+ mode = "",
+ desc = "[F]ormat buffer",
+ },
+ },
+ config = function()
+ require("conform").setup({
+ formatters_by_ft = {
+ awk = { "gawk" },
+ bash = { "shfmt" },
+ cmake = { "cmake_format" },
+ css = { "prettier", "stylelint" },
+ groovy = { "npm-groovy-lint" },
+ html = { "prettier" },
+ javascript = { "prettier" },
+ typescript = { "prettier" },
+ jenkins = { "npm-groovy-lint" },
+ json = { "jq", "jsonlint" },
+ jsonc = { "prettier" },
+ just = { "just" },
+ markdown = { "mdformat" },
+ nginx = { "nginxfmt" },
+ lua = { "stylua" },
+ python = { "ruff_format", "ruff_fix", "ruff_organize_imports" },
+ rust = { "rustfmt" },
+ sh = { "shfmt", "shellcheck", "shellharden" },
+ yaml = { "yamllint" },
+ zsh = { "shfmt", "shellcheck", "shellharden" },
+ },
+ default_format_opts = {
+ lsp_format = "fallback",
+ },
+ formatters = {
+ shfmt = {
+ prepend_args = { "-i", "2" },
+ },
+ },
+ })
+ vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
+ end,
+ },
+ {
+ "mrcjkb/rustaceanvim",
+ ft = "rust",
+ },
+ {
+ "mfussenegger/nvim-lint",
+ event = { "BufReadPre", "BufNewFile" },
+ config = function()
+ local lint = require("lint")
+
+ lint.linters_by_ft = {
+ css = { "stylelint" },
+ dockerfile = { "hadolint" },
+ groovy = { "npm-groovy-lint" },
+ jenkins = { "npm-groovy-lint" },
+ json = { "jsonlint" },
+ markdown = { "markdownlint" },
+ makefile = { "checkmake" },
+ systemd = { "systemdlint" },
+ yaml = { "yamllint", "yq" },
+ ghaction = { "actionlint" },
+ zsh = { "zsh" },
+ ["*"] = { "codespell", "typos" },
+ }
+ local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
+ vim.api.nvim_create_autocmd({ "BufReadPost", "BufWritePost" }, {
+ group = lint_augroup,
+ callback = function()
+ if vim.opt_local.modifiable:get() then
+ lint.try_lint()
+ end
+ end,
+ })
+ end,
+ },
+ {
+ "rachartier/tiny-inline-diagnostic.nvim",
+ event = "VeryLazy",
+ priority = 1000,
+ opts = {
+ options = {
+ show_source = {
+ if_many = true,
+ },
+ -- Set the arrow icon to the same color as the first diagnostic severity
+ set_arrow_to_diag_color = true,
+ -- Configuration for multiline diagnostics
+ -- Can be a boolean or a table with detailed options
+ multilines = {
+ -- Enable multiline diagnostic messages
+ enabled = true,
+ },
+
+ -- Display all diagnostic messages on the cursor line, not just those under cursor
+ show_all_diags_on_cursorline = true,
+ -- Enable diagnostics in Select mode (e.g., when auto-completing with Blink)
+ enable_on_select = true,
+ -- Configuration for breaking long messages into separate lines
+ break_line = {
+ -- Enable breaking messages after a specific length
+ enabled = true,
+ },
+ -- Filter diagnostics by severity levels
+ -- Available severities: vim.diagnostic.severity.ERROR, WARN, INFO, HINT
+ severity = {
+ vim.diagnostic.severity.ERROR,
+ vim.diagnostic.severity.WARN,
+ vim.diagnostic.severity.INFO,
+ vim.diagnostic.severity.HINT,
+ },
+ },
+ },
+ },
+}