From 6eed5630736321cb09c16491075165e5d2ab965b Mon Sep 17 00:00:00 2001 From: ErinaYip Date: Fri, 8 May 2026 23:16:32 +0800 Subject: [PATCH 1/7] feat(lualine): add options for ignored filetypes in statusline and winbar --- modules/plugins/statusline/lualine/config.nix | 2 ++ modules/plugins/statusline/lualine/lualine.nix | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/plugins/statusline/lualine/config.nix b/modules/plugins/statusline/lualine/config.nix index 010b6cd2..d7866f9b 100644 --- a/modules/plugins/statusline/lualine/config.nix +++ b/modules/plugins/statusline/lualine/config.nix @@ -68,6 +68,8 @@ in { globalstatus = mkDefault cfg.globalStatus; refresh = mkDefault cfg.refresh; always_divide_middle = mkDefault cfg.alwaysDivideMiddle; + ignore_focus = mkDefault cfg.ignoreFocus; + disabled_filetypes = mkDefault cfg.disabledFiletypes; }; sections = { diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 4e69c852..0aeb3259 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -102,10 +102,17 @@ in { default = true; }; - disabledFiletypes = mkOption { - type = listOf str; - description = "Filetypes to disable lualine on"; - default = ["alpha"]; + disabledFiletypes = { + statusline = mkOption { + type = listOf str; + default = ["alpha"]; + description = "Filetypes to disable lualine on for statusline"; + }; + winbar = mkOption { + type = listOf str; + default = [ ]; + description = "Filetypes to disable lualine on for winbar"; + }; }; ignoreFocus = mkOption { From 2e6c437f9828e7f103f38a924039e13ccc019267 Mon Sep 17 00:00:00 2001 From: ErinaYip Date: Sun, 10 May 2026 19:59:26 +0800 Subject: [PATCH 2/7] docs: update changelog for lualine disabled filetypes options --- docs/manual/release-notes/rl-0.9.md | 7 +++++++ modules/plugins/statusline/lualine/lualine.nix | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 15ef7c3f..7943a4f0 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -130,6 +130,13 @@ ## Changelog {#sec-release-0-9-changelog} +[ErinaYip](https://github.com/ErinaYip): + +- Added separate `disabledFiletypes.statusline` and `disabledFiletypes.winbar` + options in the lualine module, allowing users to configure which filetypes + should disable lualine for each component independently. Also exposed + `ignoreFocus` option. + [SecBear](https://github.com/SecBear): - Renamed `setupOpts.strategies` to `setupOpts.interactions` in the diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 0aeb3259..3411749c 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -110,7 +110,7 @@ in { }; winbar = mkOption { type = listOf str; - default = [ ]; + default = []; description = "Filetypes to disable lualine on for winbar"; }; }; From 8c71083c449a01dff70b21fd494f9283ec4e664c Mon Sep 17 00:00:00 2001 From: ErinaYip Date: Mon, 11 May 2026 12:37:07 +0800 Subject: [PATCH 3/7] docs: refine changelog and fix option references --- docs/manual/release-notes/rl-0.9.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 7943a4f0..98dcc77a 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -132,10 +132,11 @@ [ErinaYip](https://github.com/ErinaYip): -- Added separate `disabledFiletypes.statusline` and `disabledFiletypes.winbar` - options in the lualine module, allowing users to configure which filetypes - should disable lualine for each component independently. Also exposed - `ignoreFocus` option. +- Fixed and updated `lualine` options: + - Enabled the previously unmapped + {option}`vim.statusline.lualine.ignoreFocus`. + - Added {option}`vim.statusline.lualine.disabledFiletypes.statusline` and + {option}`vim.statusline.lualine.disabledFiletypes.winbar`. [SecBear](https://github.com/SecBear): From fb523e392c9f52fbe7a4e2bcff5744db93aa2d8f Mon Sep 17 00:00:00 2001 From: ErinaYip Date: Mon, 11 May 2026 15:42:07 +0800 Subject: [PATCH 4/7] docs: update lualine disabledFiletypes option --- docs/manual/release-notes/rl-0.6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/manual/release-notes/rl-0.6.md b/docs/manual/release-notes/rl-0.6.md index f7ada642..7502f2b4 100644 --- a/docs/manual/release-notes/rl-0.6.md +++ b/docs/manual/release-notes/rl-0.6.md @@ -127,7 +127,7 @@ vim.api.nvim_set_keymap('n', 'a', ':lua camelToSnake()', { noremap = and `disabled_filetypes` through the new options: {option}`vim.statusline.lualine.alwaysDivideMiddle`, {option}`vim.statusline.lualine.ignoreFocus` and - {option}`vim.statusline.lualine.disabledFiletypes`). + {option}`vim.statusline.lualine.disabledFiletypes.statusline`). - Updated all plugin inputs to their latest versions (**21.04.2024**) - this brought minor color changes to the Catppuccin theme. From c7498b44a573c82167ef4bc64546b565d628e131 Mon Sep 17 00:00:00 2001 From: alfarel Date: Sun, 17 May 2026 21:45:30 -0400 Subject: [PATCH 5/7] languages/pug: init --- configuration.nix | 1 + ...don-t-touch-git-state-while-building.patch | 25 +++++ .../by-name/prettier-plugin-pug/package.nix | 60 ++++++++++ modules/plugins/languages/default.nix | 1 + modules/plugins/languages/pug.nix | 105 ++++++++++++++++++ npins/sources.json | 16 +++ 6 files changed, 208 insertions(+) create mode 100644 flake/pkgs/by-name/prettier-plugin-pug/0001-fix-don-t-touch-git-state-while-building.patch create mode 100644 flake/pkgs/by-name/prettier-plugin-pug/package.nix create mode 100644 modules/plugins/languages/pug.nix diff --git a/configuration.nix b/configuration.nix index dfa7f92b..8831dab7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -117,6 +117,7 @@ isMaximal: { jq.enable = false; fish.enable = false; standard-ml.enable = false; + pug.enable = false; # Nim LSP is broken on Darwin and therefore # should be disabled by default. Users may still enable diff --git a/flake/pkgs/by-name/prettier-plugin-pug/0001-fix-don-t-touch-git-state-while-building.patch b/flake/pkgs/by-name/prettier-plugin-pug/0001-fix-don-t-touch-git-state-while-building.patch new file mode 100644 index 00000000..8b48bf9c --- /dev/null +++ b/flake/pkgs/by-name/prettier-plugin-pug/0001-fix-don-t-touch-git-state-while-building.patch @@ -0,0 +1,25 @@ +From 85c43d3f45b6a5d301b66fe52c0c92b16ddfbc95 Mon Sep 17 00:00:00 2001 +From: alfarel +Date: Sun, 17 May 2026 22:42:21 -0400 +Subject: [PATCH] fix: don't touch git state while building + +--- + package.json | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/package.json b/package.json +index 9151c4f..5508237 100644 +--- a/package.json ++++ b/package.json +@@ -6,7 +6,7 @@ + "clean": "git clean -fdx", + "build:clean": "git clean -fdx dist", + "build:code": "tsup-node", +- "build": "run-s build:clean build:code", ++ "build": "run-s build:code", + "docs:build": "vitepress build docs", + "docs:dev": "vitepress dev docs", + "docs:serve": "vitepress serve docs --port 5173", +-- +2.53.0 + diff --git a/flake/pkgs/by-name/prettier-plugin-pug/package.nix b/flake/pkgs/by-name/prettier-plugin-pug/package.nix new file mode 100644 index 00000000..0654604f --- /dev/null +++ b/flake/pkgs/by-name/prettier-plugin-pug/package.nix @@ -0,0 +1,60 @@ +{ + stdenv, + nodejs, + gitMinimal, + pnpm_9, + pnpmConfigHook, + fetchPnpmDeps, + pins, + fetchFromGitHub, + writableTmpDirAsHomeHook, +}: let + pin = pins.prettier-plugin-pug; +in + stdenv.mkDerivation (finalAttrs: { + pname = "prettier-plugin-pug"; + version = pin.version or pin.revision; + + patches = [ + ./0001-fix-don-t-touch-git-state-while-building.patch + ]; + + src = fetchFromGitHub { + inherit (pin.repository) owner repo; + rev = finalAttrs.version; + sha256 = pin.hash; + }; + + pnpmDeps = fetchPnpmDeps { + pnpm = pnpm_9; + inherit (finalAttrs) pname version src; + hash = "sha256-NBetqPzn99W0mvv2niL9bJ3iOexOB4VAIGA7CmUn00M="; + fetcherVersion = 3; + }; + + nativeBuildInputs = [ + nodejs + gitMinimal + writableTmpDirAsHomeHook + (pnpmConfigHook.overrideAttrs { + propagatedBuildInputs = [pnpm_9]; + }) + ]; + + buildPhase = '' + runHook preBuild + + pnpm run build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + cp -r dist/ $out + cp -r node_modules $out + + runHook postInstall + ''; + }) diff --git a/modules/plugins/languages/default.nix b/modules/plugins/languages/default.nix index 8d9ec9db..743825be 100644 --- a/modules/plugins/languages/default.nix +++ b/modules/plugins/languages/default.nix @@ -47,6 +47,7 @@ in { ./odin.nix ./openscad.nix ./php.nix + ./pug.nix ./python.nix ./qml.nix ./r.nix diff --git a/modules/plugins/languages/pug.nix b/modules/plugins/languages/pug.nix new file mode 100644 index 00000000..e0c1e092 --- /dev/null +++ b/modules/plugins/languages/pug.nix @@ -0,0 +1,105 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: let + inherit (lib.attrsets) attrNames genAttrs; + inherit (lib.options) mkOption mkEnableOption literalExpression; + inherit (lib.meta) getExe; + inherit (lib.modules) mkIf mkMerge; + inherit (lib.types) enum listOf; + inherit (lib.nvim.attrsets) mapListToAttrs; + inherit (lib.nvim.types) mkGrammarOption; + + cfg = config.vim.languages.pug; + + defaultServers = ["emmet-ls"]; + servers = ["emmet-ls"]; + + defaultFormat = ["prettier"]; + formats = { + prettier = { + command = getExe pkgs.prettier; + options.ft_parsers.pug = "pug"; + prepend_args = let + parser = "${inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.prettier-plugin-pug}/index.js"; + in ["--plugin=${parser}"]; + }; + }; +in { + options.vim.languages.pug = { + enable = mkEnableOption "Pug language support"; + + treesitter = { + enable = + mkEnableOption "Pug treesitter" + // { + default = config.vim.languages.enableTreesitter; + defaultText = literalExpression "config.vim.languages.enableTreesitter"; + }; + package = mkGrammarOption pkgs "pug"; + }; + + lsp = { + enable = + mkEnableOption "Pug LSP support" + // { + default = config.vim.lsp.enable; + defaultText = literalExpression "config.vim.lsp.enable"; + }; + servers = mkOption { + type = listOf (enum servers); + default = defaultServers; + description = "Pug LSP server to use"; + }; + }; + + format = { + enable = + mkEnableOption "Pug formatting" + // { + default = config.vim.languages.enableFormat; + defaultText = literalExpression "config.vim.languages.enableFormat"; + }; + + type = mkOption { + type = listOf (enum (attrNames formats)); + default = defaultFormat; + description = "Pug formatter to use"; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + (mkIf cfg.treesitter.enable { + vim.treesitter = { + enable = true; + grammars = [cfg.treesitter.package]; + }; + }) + + (mkIf cfg.lsp.enable { + vim.lsp = { + presets = genAttrs cfg.lsp.servers (_: {enable = true;}); + servers = genAttrs cfg.lsp.servers (_: {filetypes = ["pug"];}); + }; + }) + + (mkIf cfg.format.enable { + vim.formatter.conform-nvim = { + enable = true; + setupOpts = { + formatters_by_ft.pug = cfg.format.type; + formatters = + mapListToAttrs (name: { + inherit name; + value = formats.${name}; + }) + cfg.format.type; + }; + }; + }) + ]); +} diff --git a/npins/sources.json b/npins/sources.json index e84eee1f..f526937d 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -2395,6 +2395,22 @@ "url": "https://api.github.com/repos/withastro/prettier-plugin-astro/tarball/refs/tags/v0.14.1", "hash": "sha256-XGPz4D2UKOonet0tX3up5mCxw3/69XYPScxb9l7nzpE=" }, + "prettier-plugin-pug": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "prettier", + "repo": "plugin-pug" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "3.4.2", + "revision": "33c86341f0addf48b09968f2545efcf18331d046", + "url": "https://api.github.com/repos/prettier/plugin-pug/tarball/refs/tags/3.4.2", + "hash": "sha256-4CsKMj8Xnq+dlGzLAG2hV8jTCMYBYhaV/uoKAfztSGs=" + }, "prettier-plugin-svelte": { "type": "GitRelease", "repository": { From 5e206fb0a31329e91309dd6db9060c3adaf03727 Mon Sep 17 00:00:00 2001 From: alfarel Date: Sun, 17 May 2026 21:55:14 -0400 Subject: [PATCH 6/7] docs: add pug language module to release notes --- docs/manual/release-notes/rl-0.9.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 98dcc77a..b819ba83 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -271,6 +271,9 @@ - Allow disabling nvf's vendored keymaps by toggling `vendoredKeymaps.enable`. +- Add {option}`vim.languages.pug.enable`, which adds the treesitter grammar and + enables `emmet-ls` for pug files. + [pyrox0](https://github.com/pyrox0): - Added [rumdl](https://github.com/rvben/rumdl) support to `languages.markdown` From 07b57ebc6c9e778c536ac0ff1b01fb18dc90239a Mon Sep 17 00:00:00 2001 From: alfarel Date: Thu, 28 May 2026 23:46:04 -0400 Subject: [PATCH 7/7] package/prettier-plugin-pug: fix build and properly modernise Based on the full set of changes to the astro plugin, not just the basic fetcher update. --- .../pkgs/by-name/prettier-plugin-pug/package.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/flake/pkgs/by-name/prettier-plugin-pug/package.nix b/flake/pkgs/by-name/prettier-plugin-pug/package.nix index 0654604f..dfd99132 100644 --- a/flake/pkgs/by-name/prettier-plugin-pug/package.nix +++ b/flake/pkgs/by-name/prettier-plugin-pug/package.nix @@ -4,6 +4,7 @@ gitMinimal, pnpm_9, pnpmConfigHook, + zstd, fetchPnpmDeps, pins, fetchFromGitHub, @@ -36,25 +37,21 @@ in nodejs gitMinimal writableTmpDirAsHomeHook - (pnpmConfigHook.overrideAttrs { - propagatedBuildInputs = [pnpm_9]; + (pnpmConfigHook.override { + pnpm = pnpm_9; }) + pnpm_9 + zstd ]; buildPhase = '' runHook preBuild - pnpm run build - runHook postBuild ''; - installPhase = '' - runHook preInstall - + preInstall = '' cp -r dist/ $out cp -r node_modules $out - - runHook postInstall ''; })