From f9abbcc7939552b31e5bcde72a3a1246df92f4b1 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 14 Aug 2026 08:58:19 +0200 Subject: neovim: Füge Unterstützung für Jinja2 Templates hinzu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/format.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'nvim/lua/plugins/format.lua') diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 8ca7f1b..686de60 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua @@ -1,6 +1,7 @@ -- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters local clang = {} +local djlint = { "djlint" } -- brew install djlint (macOS); unter Windows kein winget-Paket, siehe neovim-windows-setup.md 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 @@ -30,6 +31,7 @@ return { cpp = clang, html = prettier, javascript = prettier, + jinja = djlint, json = jq, lua = stylua, python = ruff, @@ -39,6 +41,13 @@ return { xsd = xmllint, yaml = yamlfmt, }, + formatters = { + djlint = { + -- https://www.djlint.com/docs/getting-started/#template-languages + -- Ansible verwendet Jinja2-Templates. + append_args = { "--profile", "jinja" }, + }, + }, default_format_opts = { lsp_format = "fallback", }, -- cgit v1.3 From 1da598352f7a50ec2a0d96bac834d87ea7b1a836 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 2 Sep 2026 12:32:19 +0200 Subject: neovim: bootstrap Skript angepasst --- bootstrap/neovim.sh | 28 +++++++++++++++++++++++++++- nvim/lua/plugins/format.lua | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'nvim/lua/plugins/format.lua') diff --git a/bootstrap/neovim.sh b/bootstrap/neovim.sh index bf8d8ad..3d92af0 100755 --- a/bootstrap/neovim.sh +++ b/bootstrap/neovim.sh @@ -78,10 +78,36 @@ install_npm() { npm install -g "$package" } +install_pipx() { + binary="$1" + package="$2" + + if have "$binary"; then + printf "✓ %-32s vorhanden\n" "$binary" + return + fi + + if ! have pipx; then + die "pipx wurde nicht gefunden." + fi + + printf "→ Installiere pipx-Paket %s\n" "$package" + pipx install "$package" +} + install_prerequisites() { install_pkg curl curl install_pkg git git install_pkg node node + + case "$OS" in + Darwin) + install_pkg pipx pipx + ;; + FreeBSD) + install_pkg pipx py-pipx + ;; + esac } install_formatters() { @@ -92,11 +118,11 @@ install_formatters() { install_pkg shfmt shfmt install_pkg stylua stylua install_pkg yamlfmt yamlfmt + install_pipx djlint djlint case "$OS" in Darwin) install_pkg clang-format clang-format - install_pkg djlint djlint ;; FreeBSD) install_pkg xmllint libxml2 diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index 686de60..c6a2f2a 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua @@ -1,7 +1,7 @@ -- Verfügbare Formater: https://github.com/stevearc/conform.nvim/tree/master/lua/conform/formatters local clang = {} -local djlint = { "djlint" } -- brew install djlint (macOS); unter Windows kein winget-Paket, siehe neovim-windows-setup.md +local djlint = { "djlint" } -- pipx install djlint (macOS & FreeBSD); unter Windows kein winget-Paket, siehe neovim-windows-setup.md 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 -- cgit v1.3 From 98b344cbacff5fad784b88abcf05186994edcef8 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 5 Sep 2026 09:38:53 +0200 Subject: conform: Setze kein 'jinja' für djlint voraus. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/format.lua | 7 ------- 1 file changed, 7 deletions(-) (limited to 'nvim/lua/plugins/format.lua') diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua index c6a2f2a..8b40229 100644 --- a/nvim/lua/plugins/format.lua +++ b/nvim/lua/plugins/format.lua @@ -41,13 +41,6 @@ return { xsd = xmllint, yaml = yamlfmt, }, - formatters = { - djlint = { - -- https://www.djlint.com/docs/getting-started/#template-languages - -- Ansible verwendet Jinja2-Templates. - append_args = { "--profile", "jinja" }, - }, - }, default_format_opts = { lsp_format = "fallback", }, -- cgit v1.3