2024-04-23 04:34:15 +02:00
|
|
|
return {
|
|
|
|
|
|
|
|
-- formatting and linting
|
|
|
|
{
|
|
|
|
"nvimtools/none-ls.nvim",
|
|
|
|
event = "LspAttach",
|
|
|
|
opts = function()
|
|
|
|
local formatting = require("null-ls").builtins.formatting
|
|
|
|
local lint = require("null-ls").builtins.diagnostics
|
|
|
|
local code_actions = require("null-ls").builtins.code_actions
|
|
|
|
-- local actions = require("null-ls").builtins.code_actions
|
|
|
|
return {
|
|
|
|
sources = {
|
|
|
|
-- Linting
|
|
|
|
lint.cppcheck, -- for c,cpp ( Install manually using pacman )
|
2024-06-25 13:52:46 +02:00
|
|
|
-- lint.proselint, -- for md
|
2024-04-23 04:34:15 +02:00
|
|
|
lint.stylelint, -- for css
|
|
|
|
lint.codespell, -- general code spellings
|
|
|
|
|
|
|
|
-- Formatting
|
2024-06-03 07:28:14 +02:00
|
|
|
formatting.shfmt, -- for sh
|
2024-04-23 04:34:15 +02:00
|
|
|
formatting.prettier, -- for js, md, html, css``
|
|
|
|
|
|
|
|
-- Code Actions
|
|
|
|
code_actions.proselint,
|
|
|
|
code_actions.gitsigns,
|
|
|
|
code_actions.refactoring.with({
|
|
|
|
filetypes = {
|
|
|
|
"go",
|
|
|
|
"javascript",
|
|
|
|
"lua",
|
|
|
|
"python",
|
|
|
|
"typescript",
|
|
|
|
"c",
|
|
|
|
"cpp"
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
keys = {
|
|
|
|
{ "<leader>f", ":lua vim.lsp.buf.format({ timeout_ms = 2000 })<CR>", desc = "Format", silent = true },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|