From c46fef3de6ea84de7e5e69de5c8a0bd3e7c072a1 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 4 Jun 2026 11:57:56 +0200 Subject: Neovim/conform: Optionen für die Formatierung etwas aufgeräumt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/format.lua | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'nvim/lua/plugins') diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 9b1309a..3d6d5b0 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua @@ -5,28 +5,29 @@ return { { "cf", function() - require("conform").format({ - async = true, - lsp_fallback = true, - }) + require("conform").format({ async = true }) end, desc = "Format file", }, }, opts = { formatters_by_ft = { - awk = { "gawk" }, -- pkg install gawk - bash = { "shfmt" }, - -- cpp = { "clang_format" }, + awk = { "gawk" }, -- pkg install gawk + bash = { "shfmt" }, + c = {}, -- clangd + cpp = {}, -- clangd javascript = { "prettier" }, - json = { "jq" }, -- brew install jq, pkg install jq - lua = { "stylua" }, -- brew install stylua, pkg install stylua - python = { "ruff_format" }, -- brew install ruff, pkg install ruff - sh = { "shfmt" }, -- brew install, pkg install shfmt - typescript = { "prettier" }, -- npm install -g prettier - xml = { "xmllint" }, -- xmllint ist Teil von libxml2 - xsd = { "xmllint" }, - yaml = { "yamlfmt" }, -- brew install yamlfmt, pkg install yamlfmt + json = { "jq" }, -- brew install jq, pkg install jq + lua = { "stylua" }, -- brew install stylua, pkg install stylua + python = { "ruff_format" }, -- brew install ruff, pkg install ruff + sh = { "shfmt" }, -- brew install, pkg install shfmt + typescript = { "prettier" }, -- npm install -g prettier + xml = { "xmllint" }, -- xmllint ist Teil von libxml2 + xsd = { "xmllint" }, + yaml = { "yamlfmt" }, -- brew install yamlfmt, pkg install yamlfmt + }, + default_format_opts = { + lsp_format = "fallback", }, }, -- cgit v1.3