neovim/lua/weeheavy/plugins/lsp/conform.lua
2024-04-25 16:24:00 +02:00

32 lines
798 B
Lua

-- Some things are from https://www.josean.com/posts/neovim-linting-and-formatting
return {
"stevearc/conform.nvim",
tag = "stable",
opts = {},
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
svelte = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
graphql = { "prettier" },
lua = { "stylua" },
python = { "isort", "black" },
sh = { "shfmt" },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 1000, -- default: 1000
},
})
end,
}