lsp stuff

This commit is contained in:
Christoph J. Scherr 2024-01-20 16:22:40 +01:00
parent 16b7a39465
commit ab603072b9
Signed by: PlexSheep
GPG Key ID: 7CDD0B14851A08EF
3 changed files with 45 additions and 10 deletions

View File

@ -4,7 +4,16 @@ local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig" local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table -- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd", "pyright", "rust_analyzer" } local servers = {
"html",
"cssls",
"tsserver",
"clangd",
"pyright",
"rust_analyzer",
"bashls",
"cmake",
}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
lspconfig[lsp].setup { lspconfig[lsp].setup {

View File

@ -18,6 +18,7 @@ M.treesitter = {
"yaml", "yaml",
"json", "json",
"toml", "toml",
"bash",
}, },
indent = { indent = {
enable = true, enable = true,
@ -46,6 +47,7 @@ M.mason = {
-- c/cpp stuff -- c/cpp stuff
"clangd", "clangd",
"clang-format", "clang-format",
"cmake-language-server",
-- rust -- rust
"rust-analyzer", "rust-analyzer",
@ -54,9 +56,12 @@ M.mason = {
-- python -- python
"pyright", "pyright",
-- english?? -- english??
"write-good" "write-good",
-- shell
"shellcheck",
"bash-language-server",
}, },
} }

View File

@ -562,15 +562,35 @@ local plugins = {
}, },
{ {
"nvimtools/none-ls.nvim", "nvimtools/none-ls.nvim",
optional = true, event = { "BufReadPre", "BufNewFile" },
opts = function(_, opts) opts = function(_, opts)
opts.sources = {}
local nls = require "null-ls" local nls = require "null-ls"
local source = nls.builtins.diagnostics.write_good.with { local builtins = nls.builtins
diagnostics_postprocess = function(diagnostic) local sources = {
diagnostic.severity = vim.diagnostic.severity.HINT builtins.formatting.stylua,
end, builtins.formatting.black,
builtins.formatting.fixjson,
builtins.formatting.golines,
builtins.formatting.markdownlint,
builtins.formatting.shellharden,
builtins.formatting.sql_formatter,
builtins.formatting.taplo,
builtins.diagnostics.markdownlint,
builtins.diagnostics.mypy,
builtins.diagnostics.vint,
builtins.diagnostics.yamllint,
builtins.code_actions.shellcheck,
builtins.formatting.shfmt,
builtins.diagnostics.write_good.with {
diagnostics_postprocess = function(diagnostic)
diagnostic.severity = vim.diagnostic.severity.HINT
end,
},
} }
table.insert(opts.sources, source) for _, source in ipairs(sources) do
table.insert(opts.sources, source)
end
end, end,
}, },
{ {
@ -601,9 +621,10 @@ local plugins = {
end, end,
}) })
-- change how the highlighting looks -- change how the highlighting looks
vim.cmd("hi LspInlayHint guibg=bg guifg=#804d66") vim.cmd "hi LspInlayHint guibg=bg guifg=#804d66"
end, end,
}, },
{ "kosayoda/nvim-lightbulb", event = { "BufReadPre", "BufNewFile" } },
} }
return plugins return plugins