-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconform.lua
More file actions
50 lines (50 loc) · 1.08 KB
/
conform.lua
File metadata and controls
50 lines (50 loc) · 1.08 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
40
41
42
43
44
45
46
47
48
49
50
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
"<leader>F",
function()
require("conform").format({
async = true,
lsp_format = "fallback",
})
end,
desc = "[F]ormat buffer",
},
{
"<leader>cf",
function()
require("conform").format({
async = true,
lsp_format = "fallback",
})
end,
desc = "[C]ode [F]ormat",
},
},
opts = {
notify_on_error = true,
format_on_save = function()
return {
timeout_ms = 500,
lsp_format = "fallback",
}
end,
formatters_by_ft = {
c = { "clang_format" },
cpp = { "clang_format" },
go = { "gofumpt", "goimports", "gofmt" },
java = { "google_java_format" },
lua = { "stylua" },
markdown = { "prettier" },
python = { "ruff_organize_imports", "ruff_format" },
rust = { "rustfmt" },
sh = { "shfmt" },
tex = { "latexindent" },
toml = { "taplo" },
yaml = { "prettier" },
},
},
}