mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
feat(conform.lua): add support for multiple formatters for different file types to improve code formatting consistency and flexibility
This commit is contained in:
14
lua/absolute/after/conform.lua
Normal file
14
lua/absolute/after/conform.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
local conform = require("conform")
|
||||||
|
|
||||||
|
conform.setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
-- Conform will run multiple formatters sequentially
|
||||||
|
python = { "isort", "black" },
|
||||||
|
-- Use a sub-list to run only the first available formatter
|
||||||
|
javascript = { "biome" },
|
||||||
|
astro = { { "prettierd", "prettier" } },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
Reference in New Issue
Block a user