lsp stuff
This commit is contained in:
parent
16b7a39465
commit
ab603072b9
|
@ -4,7 +4,16 @@ local capabilities = require("plugins.configs.lspconfig").capabilities
|
|||
local lspconfig = require "lspconfig"
|
||||
|
||||
-- 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
|
||||
lspconfig[lsp].setup {
|
||||
|
|
|
@ -18,6 +18,7 @@ M.treesitter = {
|
|||
"yaml",
|
||||
"json",
|
||||
"toml",
|
||||
"bash",
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
|
@ -46,6 +47,7 @@ M.mason = {
|
|||
-- c/cpp stuff
|
||||
"clangd",
|
||||
"clang-format",
|
||||
"cmake-language-server",
|
||||
|
||||
-- rust
|
||||
"rust-analyzer",
|
||||
|
@ -54,9 +56,12 @@ M.mason = {
|
|||
-- python
|
||||
"pyright",
|
||||
|
||||
|
||||
-- english??
|
||||
"write-good"
|
||||
"write-good",
|
||||
|
||||
-- shell
|
||||
"shellcheck",
|
||||
"bash-language-server",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -562,15 +562,35 @@ local plugins = {
|
|||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = function(_, opts)
|
||||
opts.sources = {}
|
||||
local nls = require "null-ls"
|
||||
local source = nls.builtins.diagnostics.write_good.with {
|
||||
diagnostics_postprocess = function(diagnostic)
|
||||
diagnostic.severity = vim.diagnostic.severity.HINT
|
||||
end,
|
||||
local builtins = nls.builtins
|
||||
local sources = {
|
||||
builtins.formatting.stylua,
|
||||
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,
|
||||
},
|
||||
{
|
||||
|
@ -601,9 +621,10 @@ local plugins = {
|
|||
end,
|
||||
})
|
||||
-- change how the highlighting looks
|
||||
vim.cmd("hi LspInlayHint guibg=bg guifg=#804d66")
|
||||
vim.cmd "hi LspInlayHint guibg=bg guifg=#804d66"
|
||||
end,
|
||||
},
|
||||
{ "kosayoda/nvim-lightbulb", event = { "BufReadPre", "BufNewFile" } },
|
||||
}
|
||||
|
||||
return plugins
|
||||
|
|
Loading…
Reference in New Issue