use conform instead of formatter
This commit is contained in:
36
vim/.vim/lua/plugins/conform.lua
Normal file
36
vim/.vim/lua/plugins/conform.lua
Normal file
@ -0,0 +1,36 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
-- Conform will run multiple formatters sequentially
|
||||
-- go = { "goimports", "gofmt" },
|
||||
-- Use a sub-list to run only the first available formatter
|
||||
-- javascript = { { "prettierd", "prettier" } },
|
||||
lua = { "stylua" },
|
||||
-- Conform will run multiple formatters sequentially
|
||||
python = { "isort", "black" },
|
||||
-- Use a sub-list to run only the first available formatter
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
gdscript = { "gdformat" },
|
||||
dashboard = {},
|
||||
-- Use the "*" filetype to run formatters on all filetypes.
|
||||
["*"] = { "codespell" },
|
||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||
-- have other formatters configured.
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
formatters = {
|
||||
my_formatter = {
|
||||
command = "gdformat",
|
||||
args = { "-l 100" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user