0.0.1
This commit is contained in:
commit
36c66e33e6
17 changed files with 348 additions and 0 deletions
37
lua/plugins/conform.lua
Normal file
37
lua/plugins/conform.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
function()
|
||||
require("conform").format({ async = true })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "Format buffer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "ruff", "black" },
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true, -- современный стандарт
|
||||
},
|
||||
formatters = {
|
||||
shfmt = {
|
||||
append_args = { "-i", "2" },
|
||||
},
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue