neovim-confs/lua/custom/configs/conform.lua

30 lines
676 B
Lua
Raw Normal View History

2024-01-19 22:34:37 +01:00
local options = {
2024-01-22 20:07:30 +01:00
lsp_fallback = true,
2024-01-19 22:34:37 +01:00
2024-01-22 20:07:30 +01:00
formatters_by_ft = {
lua = { "stylua" },
2024-01-19 22:34:37 +01:00
2024-01-22 20:07:30 +01:00
javascript = { "prettier" },
css = { "prettier" },
html = { "prettier" },
2024-01-19 22:34:37 +01:00
2024-01-22 20:07:30 +01:00
sh = { "shfmt" },
toml = { "taplo" },
rust = { "rustfmt" },
2024-03-12 11:55:34 +01:00
tex = { "latexindent" },
latex = { "latexindent" },
2024-01-22 20:07:30 +01:00
},
2024-01-19 22:34:37 +01:00
-- adding same formatter for multiple filetypes can look too much work for some
-- instead of the above code you could just use a loop! the config is just a table after all!
2024-01-22 20:07:30 +01:00
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
2024-01-19 22:34:37 +01:00
}
require("conform").setup(options)