-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformatting.lua
More file actions
39 lines (36 loc) · 1.06 KB
/
Copy pathformatting.lua
File metadata and controls
39 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
return {
"stevearc/conform.nvim",
event = "VeryLazy",
opts = function()
local conform = require("conform")
vim.keymap.set("n", "<leader>rf", function()
conform.format({ lsp_format = "fallback" })
end, { desc = "Format file" })
vim.keymap.set("n", "<leader><space>", function()
conform.format({ lsp_format = "fallback" })
vim.cmd("write")
end, { desc = "Format and save" })
conform.setup({
formatters_by_ft = {
["_"] = { "trim_whitespace" },
css = { "biome-check" },
html = { "biome-check" },
javascript = { "biome-check" },
javascriptreact = { "biome-check" },
json = { "biome-check" },
jsonc = { "biome-check" },
lua = { "stylua" },
markdown = { "mdformat" },
python = { "ruff_organize_imports", "ruff_format" },
sh = { "shfmt" },
typescript = { "biome-check" },
typescriptreact = { "biome-check" },
},
formatters = {
mdformat = {
prepend_args = { "--number" },
},
},
})
end,
}