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/init.lua | 1 + nvim/lua/config/filetypes.lua | 5 +++++ nvim/lua/config/treesitter.lua | 2 ++ nvim/lua/plugins/format.lua | 9 +++++++++ 4 files changed, 17 insertions(+) create mode 100644 nvim/lua/config/filetypes.lua (limited to 'nvim') diff --git a/nvim/init.lua b/nvim/init.lua index e56561e..3535671 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,4 +1,5 @@ require("config.options") +require("config.filetypes") local keymaps = require("config.keymaps") keymaps.global() diff --git a/nvim/lua/config/filetypes.lua b/nvim/lua/config/filetypes.lua new file mode 100644 index 0000000..77fdb20 --- /dev/null +++ b/nvim/lua/config/filetypes.lua @@ -0,0 +1,5 @@ +vim.filetype.add({ + extension = { + j2 = "jinja", + }, +}) diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua index 1eee267..5969b48 100644 --- a/nvim/lua/config/treesitter.lua +++ b/nvim/lua/config/treesitter.lua @@ -7,6 +7,8 @@ M.languages = { "cpp", "html", "javascript", + "jinja", + "jinja_inline", "jq", "json", "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 701746c43cfbb807c1c032cd91f68a2f4074c035 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 14 Aug 2026 22:35:40 +0200 Subject: neovim: Aktiviere cursorcolumn bei Yaml-Dateien --- nvim/ftplugin/yaml.lua | 3 +++ nvim/lua/config/colorscheme.lua | 1 + 2 files changed, 4 insertions(+) create mode 100644 nvim/ftplugin/yaml.lua (limited to 'nvim') diff --git a/nvim/ftplugin/yaml.lua b/nvim/ftplugin/yaml.lua new file mode 100644 index 0000000..a2a37eb --- /dev/null +++ b/nvim/ftplugin/yaml.lua @@ -0,0 +1,3 @@ +local opt = vim.opt_local + +opt.cursorcolumn = true diff --git a/nvim/lua/config/colorscheme.lua b/nvim/lua/config/colorscheme.lua index 8d944c3..ddd1d6a 100644 --- a/nvim/lua/config/colorscheme.lua +++ b/nvim/lua/config/colorscheme.lua @@ -4,6 +4,7 @@ vim.api.nvim_set_hl(0, "SpellCap", { fg = "#000000", bg = "#ffaf00" }) vim.api.nvim_set_hl(0, "SpellRare", { fg = "#000000", bg = "#5fd7ff" }) vim.api.nvim_set_hl(0, "SpellLocal", { fg = "#000000", bg = "#5fff87" }) vim.api.nvim_set_hl(0, "CursorLine", { bg = "#252526" }) +vim.api.nvim_set_hl(0, "CursorColumn", { bg = "#252526" }) -- Statusline Farben vim.api.nvim_set_hl(0, "StatuslineModeNormal", { fg = "#1e222a", bg = "#61afef", bold = true }) -- 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') 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 cb9ddf7598f847329b08d8e38ccea2fc4e9752a0 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 2 Sep 2026 23:04:57 +0200 Subject: erstmal kein Treesiter für Jinja... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/config/treesitter.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nvim') diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua index 5969b48..f122f37 100644 --- a/nvim/lua/config/treesitter.lua +++ b/nvim/lua/config/treesitter.lua @@ -7,8 +7,8 @@ M.languages = { "cpp", "html", "javascript", - "jinja", - "jinja_inline", + -- "jinja", + -- "jinja_inline", "jq", "json", "lua", -- 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') 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