1 parent
b1a92f479d
commit
b5f1714ee7
35 files changed
+1815
-2067
No files matched your search
+34
-10
@@ -1,12 +1,36 @@
|
||||
return {
|
||||
'stevearc/conform.nvim',
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
cpp = { "clang-format", lsp_format = "fallback"}
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
},
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
cpp = { "clang-format", lsp_format = "never" },
|
||||
lua = { "stylua", prettier = "fallback" },
|
||||
cmake = { "cmake_format", lsp_format = "fallback" },
|
||||
["*"] = { "codespell" },
|
||||
},
|
||||
formatters = {
|
||||
-- Apply to ALL formatters that use temp files
|
||||
["*"] = {
|
||||
tmpfile_format = "/tmp/.conform.$RANDOM.$FILENAME",
|
||||
},
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
},
|
||||
|
||||
config = function(opts)
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup(opts)
|
||||
local util = require("conform.util")
|
||||
local original_tmpfile = util.tmpfile_name
|
||||
util.tmpfile_name = function(ctx, formatter)
|
||||
return string.format(
|
||||
"/tmp/.conform.%s.%s",
|
||||
math.random(1000000, 9999999),
|
||||
vim.fn.fnamemodify(ctx.filename, ":t")
|
||||
)
|
||||
end
|
||||
end,
|
||||
}
|
||||
Reference in new issue
Block a user