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

27 lines
615 B
Lua
Raw Permalink 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-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)