nvim-config/lua/myLuaConf/format.lua
Gabe Venberg 9a78fd2d53 inital commit,
initalized from nix flake init -t github:BirdeeHub/nixCats-nvim#example.
2025-06-27 21:05:54 +02:00

38 lines
1 KiB
Lua

require('lze').load {
{
"conform.nvim",
for_cat = 'format',
-- cmd = { "" },
-- event = "",
-- ft = "",
keys = {
{ "<leader>FF", desc = "[F]ormat [F]ile" },
},
-- colorscheme = "",
after = function (plugin)
local conform = require("conform")
conform.setup({
formatters_by_ft = {
-- NOTE: download some formatters in lspsAndRuntimeDeps
-- and configure them here
-- lua = { "stylua" },
-- go = { "gofmt", "golint" },
-- templ = { "templ" },
-- Conform will run multiple formatters sequentially
-- python = { "isort", "black" },
-- Use a sub-list to run only the first available formatter
-- javascript = { { "prettierd", "prettier" } },
},
})
vim.keymap.set({ "n", "v" }, "<leader>FF", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = "[F]ormat [F]ile" })
end,
},
}