-- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters local clang = {} local gawk = { "gawk" } -- brew install gawk, pkg install gawk local jq = { "jq" } -- brew install jq, pkg install jq local prettier = { "prettier " } -- npm install -g prettier local ruff = { "ruff_format" } -- brew install ruff, pkg install ruff local shfmt = { "shfmt" } -- brew install shfmt, pkg install shfmt local stylua = { "stylua" } -- brew install stylua, pkg install stylua local xmllint = { "xmllint" } -- xmllint ist Teil von libxml2 (standardmäßig installiert unter MacOS; pkg install libxml2) local yamlfmt = { "yamlfmt" } -- brew install yamlfmt, pkg install yamlfmt return { "stevearc/conform.nvim", event = { "BufReadPre", "BufNewFile" }, keys = { { "cf", function() require("conform").format({ async = true }) end, desc = "Format file", }, }, opts = { formatters_by_ft = { awk = gawk, bash = shfmt, c = clang, cpp = clang, html = prettier, javascript = prettier, json = jq, lua = stylua, python = ruff, sh = shfmt, typescript = prettier, xml = xmllint, xsd = xmllint, yaml = yamlfmt, }, default_format_opts = { lsp_format = "fallback", }, }, }