46 lines
1.2 KiB
Lua
46 lines
1.2 KiB
Lua
return {
|
|||
|
|
"stevearc/conform.nvim",
|
||
|
|
event = { "BufReadPre", "BufNewFile" },
|
||
|
|
config = function()
|
||
|
|
local conform = require("conform")
|
||
|
|
|
||
|
|
conform.setup({
|
||
|
|
formatters_by_ft = {
|
||
|
|
-- T3 Stack / Next.js
|
||
|
|
javascript = { "prettier" },
|
||
|
|
typescript = { "prettier" },
|
||
|
|
javascriptreact = { "prettier" },
|
||
|
|
typescriptreact = { "prettier" },
|
||
|
|
css = { "prettier" },
|
||
|
|
html = { "prettier" },
|
||
|
|
json = { "prettier" },
|
||
|
|
yaml = { "prettier" },
|
||
|
|
|
||
|
|
-- Rust (Beépített, de biztosra mehetünk)
|
||
|
|
rust = { "rustfmt" },
|
||
|
|
|
||
|
|
-- Terraform
|
||
|
|
terraform = { "terraform_fmt" },
|
||
|
|
hcl = { "terraform_fmt" },
|
||
|
|
|
||
|
|
-- Docker
|
||
|
|
dockerfile = { "hadolint" }, -- Ha nincs telepítve, vedd ki
|
||
|
|
},
|
||
|
|
-- Automatikus formázás mentéskor (Opcionális, de ajánlott)
|
||
|
|
format_on_save = {
|
||
|
|
lsp_fallback = true,
|
||
|
|
async = false,
|
||
|
|
timeout_ms = 1000,
|
||
|
|
},
|
||
|
|
})
|
||
|
|
|
||
|
|
-- Billentyűkombináció: Leader + f (mint "Format")
|
||
|
|
vim.keymap.set({ "n", "v" }, "<leader>f", function()
|
||
|
|
conform.format({
|
||
|
|
lsp_fallback = true,
|
||
|
|
async = false,
|
||
|
|
timeout_ms = 1000,
|
||
|
|
})
|
||
|
|
end, { desc = "Fájl formázása" })
|
||
|
|
end,
|
||
|
|
}
|