1
0
Fork 0
dotfiles/.config/nvim/lua/plugins/lsp/null-ls.lua

29 lines
799 B
Lua

local M = { "nvimtools/none-ls.nvim" }
M.event = { "BufReadPre", "BufNewFile" }
M.dependencies = { "mason-null-ls.nvim" }
M.opts = function()
local nls = require("null-ls")
return {
root_dir = require("null-ls.utils").root_pattern(".null-ls-root", "Makefile", ".git"),
sources = {
-- shell
nls.builtins.formatting.shfmt,
nls.builtins.code_actions.shellcheck,
-- python
nls.builtins.formatting.black,
-- perl
nls.builtins.formatting.perltidy,
-- Various (yaml, markdown, json among others)
nls.builtins.formatting.prettierd,
},
on_attach = function()
return { on_attach = require("funcs").lsp_on_attach }
end
}
end
return M