From f47268bdb61ea02f6dc1ece2c699473277107947 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Tue, 24 Mar 2026 22:09:32 +0100 Subject: Neovim: conform arbeitet unabhängig von LSP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/format.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'nvim/lua/plugins/format.lua') diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 2d6a55c..9010657 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua @@ -1,12 +1,24 @@ return { "stevearc/conform.nvim", event = { "BufReadPre", "BufNewFile" }, + keys = { + { + "cf", + function() + require("conform").format({ + async = true, + lsp_fallback = true, + }) + end, + desc = "Format file", + }, + }, opts = { formatters_by_ft = { - sh = { "shfmt" }, -- brew install, pkg install shfmt + sh = { "shfmt" }, -- brew install, pkg install shfmt bash = { "shfmt" }, python = { "ruff_format", "black" }, -- brew install ruff, pkg install ruff - lua = { "stylua" }, -- brew install stylua, pkg install stylua + lua = { "stylua" }, -- brew install stylua, pkg install stylua typescript = { "prettierd", "prettier" }, javascript = { "prettierd", "prettier" }, json = { "jq" }, -- brew install jq, pkg install jq -- cgit v1.3