luca-awesome-dotfiles/home/.config/nvim/lua/lsp-config/null-ls.lua
2022-11-23 03:44:40 +01:00

22 lines
457 B
Lua

local null_ls = require("null-ls")
local formatting = null_ls.builtins.formatting
local sources = {
formatting.eslint,
formatting.autopep8,
formatting.stylua,
formatting.clang_format,
-- formatting.prettier,
-- formatting.latexindent,
}
null_ls.setup({
sources = sources,
on_attach = function(client)
if client.server_capabilities.document_formatting then
vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting()")
end
end,
})