|
@ -75,16 +75,28 @@ null_ls.setup({ |
|
|
}) |
|
|
}) |
|
|
end, |
|
|
end, |
|
|
sources = { |
|
|
sources = { |
|
|
null_ls.builtins.formatting.prettier, |
|
|
|
|
|
null_ls.builtins.formatting.autopep8, |
|
|
|
|
|
null_ls.builtins.formatting.gofmt, |
|
|
|
|
|
null_ls.builtins.diagnostics.eslint, |
|
|
|
|
|
null_ls.builtins.diagnostics.shellcheck, |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd("BufWritePre", { |
|
|
|
|
|
pattern = { "*.go", "*.py", "*.lua", "*.rs" }, |
|
|
|
|
|
callback = function(args) |
|
|
|
|
|
vim.lsp.buf.format { |
|
|
|
|
|
timeout_ms = 5000 |
|
|
|
|
|
} |
|
|
|
|
|
end |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
vim.keymap.set("n", "<leader>ft", function() |
|
|
|
|
|
vim.lsp.buf.format() |
|
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
require('mason').setup() |
|
|
|
|
|
|
|
|
require('mason-null-ls').setup({ |
|
|
require('mason-null-ls').setup({ |
|
|
ensure_installed = nil, |
|
|
|
|
|
|
|
|
ensure_installed = { "prettier", "autopep8", "eslint", "gofmt", "rustfmt", "shellcheck" }, |
|
|
automatic_installation = true, |
|
|
automatic_installation = true, |
|
|
automatic_setup = false, |
|
|
|
|
|
|
|
|
automatic_setup = true, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
require('mason-null-ls').setup_handlers() |