From 70f1eef5b508511e8e298dc9e56509c00c287e52 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 4 Sep 2026 00:07:12 +0200 Subject: [PATCH 1/7] plugins/lualine: fix duplicate diagnostic data reported by @alexperreault --- modules/plugins/statusline/lualine/lualine.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 97d3ec65f..2c5849332 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -275,7 +275,7 @@ in { '' { "diagnostics", - sources = {'nvim_lsp', 'nvim_diagnostic', 'nvim_diagnostic', 'vim_lsp', 'coc'}, + sources = {'nvim_lsp', 'nvim_diagnostic', 'vim_lsp', 'coc'}, symbols = {error = '󰅙 ', warn = ' ', info = ' ', hint = '󰌵 '}, colored = true, update_in_insert = false, From e85637e87b3eece0fc6a4c90aafab4c8ba61e571 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 4 Sep 2026 01:44:15 +0200 Subject: [PATCH 2/7] plugins/lualine: remove theme option --- modules/plugins/statusline/lualine/config.nix | 1 - .../plugins/statusline/lualine/lualine.nix | 66 ------------------- .../statusline/lualine/supported_themes.nix | 9 --- 3 files changed, 76 deletions(-) delete mode 100644 modules/plugins/statusline/lualine/supported_themes.nix diff --git a/modules/plugins/statusline/lualine/config.nix b/modules/plugins/statusline/lualine/config.nix index 31f94f0a1..8676b3045 100644 --- a/modules/plugins/statusline/lualine/config.nix +++ b/modules/plugins/statusline/lualine/config.nix @@ -277,7 +277,6 @@ in { statusline.lualine.setupOpts = { options = { icons_enabled = mkDefault cfg.icons.enable; - theme = mkDefault cfg.theme; component_separators = mkDefault cfg.componentSeparator; section_separators = mkDefault cfg.sectionSeparator; globalstatus = mkDefault cfg.globalStatus; diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 2c5849332..1c1f153fe 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -9,61 +9,6 @@ inherit (lib.lists) optional; inherit (lib.nvim.types) mkPluginSetupOption borderType; inherit (config.vim.lib) mkMappingOption; - - supported_themes = import ./supported_themes.nix; - builtin_themes = [ - "auto" - "16color" - "ayu_dark" - "ayu_light" - "ayu_mirage" - "ayu" - "base16" - "codedark" - "dracula" - "everforest" - "github_dark" - "github_light" - "github_dark_dimmed" - "github_dark_default" - "github_light_default" - "github_dark_high_contrast" - "github_light_high_contrast" - "github_dark_colorblind" - "github_light_colorblind" - "github_dark_tritanopia" - "github_light_tritanopia" - "gruvbox" - "gruvbox_dark" - "gruvbox_light" - "gruvbox-material" - "horizon" - "iceberg_dark" - "iceberg_light" - "iceberg" - "jellybeans" - "material" - "modus-vivendi" - "molokai" - "moonfly" - "nightfly" - "nord" - "OceanicNext" - "onedark" - "onelight" - "palenight" - "papercolor_dark" - "papercolor_light" - "PaperColor" - "powerline_dark" - "powerline" - "pywal" - "seoul256" - "solarized_dark" - "solarized_light" - "Tomorrow" - "wombat" - ]; in { options.vim.statusline.lualine = { enable = mkEnableOption "lualine statusline plugin"; @@ -125,17 +70,6 @@ in { ''; }; - theme = let - themeSupported = elem config.vim.theme.name supported_themes; - themesConcatted = builtin_themes ++ optional themeSupported config.vim.theme.name; - in - mkOption { - type = enum themesConcatted; - default = "auto"; - defaultText = ''`config.vim.theme.name` if theme supports lualine else "auto"''; - description = "Theme for lualine"; - }; - sectionSeparator = { left = mkOption { type = str; diff --git a/modules/plugins/statusline/lualine/supported_themes.nix b/modules/plugins/statusline/lualine/supported_themes.nix deleted file mode 100644 index b7fe2de8d..000000000 --- a/modules/plugins/statusline/lualine/supported_themes.nix +++ /dev/null @@ -1,9 +0,0 @@ -[ - "tokyonight" - "onedark" - "catppuccin" - "oxocarbon" - "gruvbox" - "nord" - "mellow" -] From d1f9eb4a05286220c7ca345b166ab8b290fe2d5a Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 4 Sep 2026 02:39:58 +0200 Subject: [PATCH 3/7] plugins/lualine: fully migrate to setupOpts --- modules/plugins/statusline/lualine/config.nix | 34 -- .../plugins/statusline/lualine/lualine.nix | 469 ++++++------------ 2 files changed, 145 insertions(+), 358 deletions(-) diff --git a/modules/plugins/statusline/lualine/config.nix b/modules/plugins/statusline/lualine/config.nix index 8676b3045..c278ee121 100644 --- a/modules/plugins/statusline/lualine/config.nix +++ b/modules/plugins/statusline/lualine/config.nix @@ -270,40 +270,6 @@ in { local lualine = require('lualine') lualine.setup ${toLuaObject cfg.setupOpts} ''; - - # this is for backwards-compatibility - # NOTE: since lualine relies heavily on mixed list + key-value table syntax in lua e.g. {1, 2, three = 3} - # and we don't have a good syntax for that we're keeping the old options for now - statusline.lualine.setupOpts = { - options = { - icons_enabled = mkDefault cfg.icons.enable; - component_separators = mkDefault cfg.componentSeparator; - section_separators = mkDefault cfg.sectionSeparator; - 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 = { - lualine_a = mkDefault (map mkLuaInline (cfg.activeSection.a ++ cfg.extraActiveSection.a)); - lualine_b = mkDefault (map mkLuaInline (cfg.activeSection.b ++ cfg.extraActiveSection.b)); - lualine_c = mkDefault (map mkLuaInline (cfg.activeSection.c ++ cfg.extraActiveSection.c)); - lualine_x = mkDefault (map mkLuaInline (cfg.activeSection.x ++ cfg.extraActiveSection.x)); - lualine_y = mkDefault (map mkLuaInline (cfg.activeSection.y ++ cfg.extraActiveSection.y)); - lualine_z = mkDefault (map mkLuaInline (cfg.activeSection.z ++ cfg.extraActiveSection.z)); - }; - - inactive_sections = { - lualine_a = mkDefault (map mkLuaInline (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a)); - lualine_b = mkDefault (map mkLuaInline (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b)); - lualine_c = mkDefault (map mkLuaInline (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c)); - lualine_x = mkDefault (map mkLuaInline (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x)); - lualine_y = mkDefault (map mkLuaInline (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y)); - lualine_z = mkDefault (map mkLuaInline (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z)); - }; - }; }; }) ]; diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 1c1f153fe..6292ae7cd 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -3,181 +3,91 @@ lib, ... }: let - inherit (builtins) elem; inherit (lib.options) mkOption mkEnableOption; - inherit (lib.types) int bool str listOf enum nullOr; - inherit (lib.lists) optional; + inherit (lib.types) int bool str listOf enum nullOr anything; inherit (lib.nvim.types) mkPluginSetupOption borderType; + inherit (lib.generators) mkLuaInline; inherit (config.vim.lib) mkMappingOption; in { options.vim.statusline.lualine = { enable = mkEnableOption "lualine statusline plugin"; - setupOpts = mkPluginSetupOption "Lualine" {}; - - icons.enable = mkEnableOption "icons for lualine" // {default = true;}; - - refresh = { - statusline = mkOption { - type = int; - description = "Refresh rate for lualine"; - default = 1000; - }; - - tabline = mkOption { - type = int; - description = "Refresh rate for tabline"; - default = 1000; - }; - - winbar = mkOption { - type = int; - description = "Refresh rate for winbar"; - default = 1000; - }; - }; - - globalStatus = mkOption { - type = bool; - description = "Enable global status for lualine"; - default = true; - }; - - alwaysDivideMiddle = mkOption { - type = bool; - description = "Always divide middle section"; - default = true; - }; - - 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 { - type = listOf str; - default = ["NvimTree"]; - description = '' - If current filetype is in this list it'll always be drawn as inactive statusline - and the last window will be drawn as active statusline. - ''; - }; - - sectionSeparator = { - left = mkOption { - type = str; - description = "Section separator for left side"; - default = ""; - }; - - right = mkOption { - type = str; - description = "Section separator for right side"; - default = ""; - }; - }; - - componentSeparator = { - left = mkOption { - type = str; - description = "Component separator for left side"; - default = ""; - }; - - right = mkOption { - type = str; - description = "Component separator for right side"; - default = ""; - }; - }; - - activeSection = { - a = mkOption { - type = listOf str; + setupOpts = mkPluginSetupOption "Lualine" { + sections.lualine_a = mkOption { + type = listOf anything; description = "active config for: | (A) | B | C X | Y | Z |"; default = [ - '' - { - "mode", - icons_enabled = true, - separator = { - left = '▎', - right = '' - }, - } - '' - '' - { - "", - draw_empty = true, - separator = { left = '', right = '' } - } - '' + { + "@1" = "mode"; + icons_enabled = true; + separator = { + left = "▎"; + right = ""; + }; + } + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } ]; }; - - b = mkOption { - type = listOf str; + sections.lualine_b = mkOption { + type = listOf anything; description = "active config for: | A | (B) | C X | Y | Z |"; default = [ - '' - { - "filetype", - colored = true, - icon_only = true, - icon = { align = 'left' } - } - '' - '' - { - "filename", - symbols = {modified = ' ', readonly = ' '}, - separator = {right = ''} - } - '' - '' - { - "", - draw_empty = true, - separator = { left = '', right = '' } - } - '' + { + "@1" = "filetype"; + colored = true; + icon_only = true; + icon = {align = "left";}; + } + { + "@1" = "filename"; + symbols = { + modified = " "; + readonly = " "; + }; + separator = {right = "";}; + } + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } ]; }; - - c = mkOption { - type = listOf str; + sections.lualine_c = mkOption { + type = listOf anything; description = "active config for: | A | B | (C) X | Y | Z |"; default = [ - '' - { - "diff", - colored = false, - diff_color = { - -- Same color values as the general color option can be used here. - added = 'DiffAdd', -- Changes the diff's added color - modified = 'DiffChange', -- Changes the diff's modified color - removed = 'DiffDelete', -- Changes the diff's removed color you - }, - symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the diff symbols - separator = {right = ''} - } - '' + { + "@1" = "diff"; + colored = false; + diff_color = { + added = "DiffAdd"; + modified = "DiffChange"; + removed = "DiffDelete"; + }; + symbols = { + added = "+"; + modified = "~"; + removed = "-"; + }; + separator = {right = "";}; + } ]; }; - - x = mkOption { - type = listOf str; + sections.lualine_x = mkOption { + type = listOf anything; description = "active config for: | A | B | C (X) | Y | Z |"; default = [ - '' + (mkLuaInline '' { -- Lsp server name function() @@ -202,204 +112,115 @@ in { return table.concat(active_clients, ", ") end, - icon = ' ', - separator = {left = ''}, + icon = " ", + separator = {left = ""}, } - '' - '' - { - "diagnostics", - sources = {'nvim_lsp', 'nvim_diagnostic', 'vim_lsp', 'coc'}, - symbols = {error = '󰅙 ', warn = ' ', info = ' ', hint = '󰌵 '}, - colored = true, - update_in_insert = false, - always_visible = false, - diagnostics_color = { - color_error = { fg = 'red' }, - color_warn = { fg = 'yellow' }, - color_info = { fg = 'cyan' }, - }, - } - '' + '') + { + "@1" = "diagnostics"; + sources = ["nvim_lsp" "nvim_diagnostic" "vim_lsp" "coc"]; + symbols = { + error = "󰅙 "; + warn = " "; + info = " "; + hint = "󰌵 "; + }; + colored = true; + update_in_insert = false; + always_visible = false; + diagnostics_color = { + color_error = {fg = "red";}; + color_warn = {fg = "yellow";}; + color_info = {fg = "cyan";}; + }; + } ]; }; - - y = mkOption { - type = listOf str; + sections.lualine_y = mkOption { + type = listOf anything; description = "active config for: | A | B | C X | (Y) | Z |"; default = [ - '' - { - "", - draw_empty = true, - separator = { left = '', right = '' } - } - '' - '' - { - 'searchcount', - maxcount = 999, - timeout = 120, - separator = {left = ''} - } - '' - '' - { - "branch", - icon = ' •', - separator = {left = ''} - } - '' + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } + { + "@1" = "t"; + maxcount = 999; + timeout = 120; + separator = {left = "";}; + } + { + "@1" = "branch"; + icon = "•"; + separator = {left = "";}; + } ]; }; - - z = mkOption { - type = listOf str; + sections.lualine_z = mkOption { + type = listOf anything; description = "active config for: | A | B | C X | Y | (Z) |"; default = [ - '' - { - "", - draw_empty = true, - separator = { left = '', right = '' } - } - '' - '' - { - "progress", - separator = {left = ''} - } - '' - '' - {"location"} - '' - '' - { - "fileformat", - color = {fg='black'}, - symbols = { - unix = '', -- e712 - dos = '', -- e70f - mac = '', -- e711 - } - } - '' + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } + { + "@1" = "progress"; + separator = {left = "";}; + } + ["location"] + { + "@1" = "fileformat"; + color = {fg = "black";}; + symbols = { + unix = ""; + dos = ""; + mac = ""; + }; + } ]; }; - }; - extraActiveSection = { - a = mkOption { - type = listOf str; - description = "Extra entries for activeSection.a"; - default = []; - }; - - b = mkOption { - type = listOf str; - description = "Extra entries for activeSection.b"; - default = []; - }; - - c = mkOption { - type = listOf str; - description = "Extra entries for activeSection.c"; - default = []; - }; - - x = mkOption { - type = listOf str; - description = "Extra entries for activeSection.x"; - default = []; - }; - - y = mkOption { - type = listOf str; - description = "Extra entries for activeSection.y"; - default = []; - }; - - z = mkOption { - type = listOf str; - description = "Extra entries for activeSection.z"; - default = []; - }; - }; - - inactiveSection = { - a = mkOption { - type = listOf str; + inactive_sections.lualine_a = mkOption { + type = listOf anything; description = "inactive config for: | (A) | B | C X | Y | Z |"; default = []; }; - - b = mkOption { - type = listOf str; + inactive_sections.lualine_b = mkOption { + type = listOf anything; description = "inactive config for: | A | (B) | C X | Y | Z |"; default = []; }; - - c = mkOption { - type = listOf str; + inactive_sections.lualine_c = mkOption { + type = listOf anything; description = "inactive config for: | A | B | (C) X | Y | Z |"; - default = ["'filename'"]; + default = ["filename"]; }; - - x = mkOption { - type = listOf str; + inactive_sections.lualine_x = mkOption { + type = listOf anything; description = "inactive config for: | A | B | C (X) | Y | Z |"; - default = ["'location'"]; + default = ["location"]; }; - - y = mkOption { - type = listOf str; + inactive_sections.lualine_y = mkOption { + type = listOf anything; description = "inactive config for: | A | B | C X | (Y) | Z |"; default = []; }; - - z = mkOption { - type = listOf str; + inactive_sections.lualine_z = mkOption { + type = listOf anything; description = "inactive config for: | A | B | C X | Y | (Z) |"; default = []; }; }; - extraInactiveSection = { - a = mkOption { - type = listOf str; - description = "Extra entries for inactiveSection.a"; - default = []; - }; - - b = mkOption { - type = listOf str; - description = "Extra entries for inactiveSection.b"; - default = []; - }; - - c = mkOption { - type = listOf str; - description = "Extra entries for inactiveSection.c"; - default = []; - }; - - x = mkOption { - type = listOf str; - description = "Extra entries for inactiveSection.x"; - default = []; - }; - - y = mkOption { - type = listOf str; - description = "Extra entries for inactiveSection.y"; - default = []; - }; - - z = mkOption { - type = listOf str; - description = "Extra entries for inactiveSection.z"; - default = []; - }; - }; integrations = { breadcrumbs = { From 4bee299a591852aa537bd7625832c74802b36d33 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 4 Sep 2026 02:40:18 +0200 Subject: [PATCH 4/7] deprecations: lualine deprecations --- modules/extra/deprecations.nix | 106 +++++++++++++-------------------- 1 file changed, 42 insertions(+), 64 deletions(-) diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 12e18e72f..ca094e8f1 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -1,70 +1,7 @@ {lib, ...}: let - inherit (builtins) head; - inherit (lib.modules) mkRemovedOptionModule mkRenamedOptionModule doRename; + inherit (lib.modules) mkRemovedOptionModule mkRenamedOptionModule; inherit (lib.lists) concatLists; inherit (lib.nvim.config) batchRenameOptions; - inherit (lib.trivial) warn; - - renamedVimOpts = batchRenameOptions ["vim"] ["vim" "options"] { - # 2024-12-01 - colourTerm = "termguicolors"; - mouseSupport = "mouse"; - cmdHeight = "cmdheight"; - updateTime = "updatetime"; - mapTimeout = "tm"; - cursorlineOpt = "cursorlineopt"; - splitBelow = "splitbelow"; - splitRight = "splitright"; - autoIndent = "autoindent"; - wordWrap = "wrap"; - showSignColumn = "signcolumn"; - - # 2025-02-07 - scrollOffset = "scrolloff"; - }; - - mkRemovedLspOpt = lang: (mkRemovedOptionModule ["vim" "languages" lang "lsp" "opts"] '' - `vim.languages.${lang}.lsp.opts` is now moved to `vim.lsp.servers..init_options` - ''); - - mkRemovedLspPackage = lang: (mkRemovedOptionModule ["vim" "languages" lang "lsp" "package"] '' - `vim.languages.${lang}.lsp.package` is now moved to `vim.lsp.servers..cmd` - ''); - - mkRenamedLspServer = lang: - doRename - { - from = ["vim" "languages" lang "lsp" "server"]; - to = ["vim" "languages" lang "lsp" "servers"]; - visible = false; - warn = true; - use = x: - warn - "Obsolete option `vim.languages.${lang}.lsp.server` used, use `vim.languages.${lang}.lsp.servers` instead." - (head x); - }; - - mkRemovedFormatPackage = lang: (mkRemovedOptionModule ["vim" "languages" lang "format" "package"] '' - `vim.languages.${lang}.format.package` is removed, please use `vim.formatter.conform-nvim.formatters..command` instead. - ''); - - mkRemovedEnumListOption = optionPath: removedValue: msg: { - config, - lib, - ... - }: let - inherit (lib) elem attrByPath concatStringsSep; - in { - config.assertions = [ - { - assertion = !(elem removedValue (attrByPath optionPath [] config)); - message = '' - The value `${removedValue}` was removed from `${concatStringsSep "." optionPath}`. - ${msg} - ''; - } - ]; - }; in { imports = concatLists [ # 2026-07-28 @@ -99,5 +36,46 @@ in { Dirtytalk is unmaintained and no longer works. '') ] + + # 2026-09-04 + (batchRenameOptions + ["vim" "statusline" "lualine"] + ["vim" "statusline" "lualine" "setupOpts" "options"] + { + theme = "theme"; + componentSeparator = "component_separators"; + sectionSeparator = "section_separators"; + globalStatus = "globalstatus"; + refresh = "refresh"; + alwaysDivideMiddle = "always_divide_middle"; + ignoreFocus = "ignore_focus"; + disabledFiletypes = "disabled_filetypes"; + }) + [ + (mkRemovedOptionModule ["vim" "statusline" "lualine" "activeSection"] + '' + Please use `vim.statusline.lualine.setupOpts.sections` instead. + '') + (mkRemovedOptionModule ["vim" "statusline" "lualine" "extraActiveSection"] + '' + Please use `vim.statusline.lualine.setupOpts.sections` with mkDefault + and mkAfter instead. + '') + + (mkRemovedOptionModule ["vim" "statusline" "lualine" "inactiveSection"] + '' + Please use `vim.statusline.lualine.setupOpts.inactive_sections` + instead. + '') + (mkRemovedOptionModule ["vim" "statusline" "lualine" "extraInactiveSection"] + '' + Please use `vim.statusline.lualine.setupOpts.inactive_sections` + with mkDefault and mkAfter instead. + '') + ] + + [ + (mkRenamedOptionModule ["vim" "statusline" "lualine" "icons" "enable"] ["vim" "statusline" "lualine" "setupOpts" "options" "icons_enabled"]) + ] ]; } From cb84762d6ee40bd3f5ed45d24a1f60791dd87f09 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 4 Sep 2026 02:40:36 +0200 Subject: [PATCH 5/7] docs: update release notes --- docs/manual/release-notes/rl-26.12.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/manual/release-notes/rl-26.12.md b/docs/manual/release-notes/rl-26.12.md index b43bde990..e53f82054 100644 --- a/docs/manual/release-notes/rl-26.12.md +++ b/docs/manual/release-notes/rl-26.12.md @@ -37,6 +37,33 @@ - Removed `vim-dirtytalk` from `spellcheck` as it is unmaintained and no longer works. +[horriblename](https://github.com/horriblename) + +- Fully migrate lualine to setupOpts. + - For lualine sections, you can start by adding `map mkLuaInline` (use + `mkDefault + mkAfter` if you are converting `extra*Section` instead): + + ```diff + vim.statusline.lualine = { + # use `map mkLuaInline` to get something working quick, then + # nixify each option at your own pace + - activeSection.a = [ + + sections.lualine_a = map lib.generators.mkLuaInline [ + "'filetype'" + "{'location', some_option = false}" + ]; + + # use mkDefault + mkAfter to extend NVF defaults instead of replace + - extraInactiveSection.x = + + inactive_sections.lualine_x = + + mkDefault (mkAfter (map lib.generators.mkLuaInline + [ + "function() return 'something' end" + - ]; + + ])); + }; + ``` + ## Changelog {#sec-release-26-12-changelog} [Snoweuph](https://github.com/snoweuph) From f1f1047a50afb8561d92dae861f80741a1abd1f6 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 4 Sep 2026 02:48:55 +0200 Subject: [PATCH 6/7] fixup! plugins/lualine: fully migrate to setupOpts --- .../plugins/statusline/lualine/lualine.nix | 400 +++++++++--------- 1 file changed, 202 insertions(+), 198 deletions(-) diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 6292ae7cd..3994915e9 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -12,213 +12,217 @@ in { options.vim.statusline.lualine = { enable = mkEnableOption "lualine statusline plugin"; setupOpts = mkPluginSetupOption "Lualine" { - sections.lualine_a = mkOption { - type = listOf anything; - description = "active config for: | (A) | B | C X | Y | Z |"; - default = [ - { - "@1" = "mode"; - icons_enabled = true; - separator = { - left = "▎"; - right = ""; - }; - } - { - "@1" = ""; - draw_empty = true; - separator = { - left = ""; - right = ""; - }; - } - ]; - }; - sections.lualine_b = mkOption { - type = listOf anything; - description = "active config for: | A | (B) | C X | Y | Z |"; - default = [ - { - "@1" = "filetype"; - colored = true; - icon_only = true; - icon = {align = "left";}; - } - { - "@1" = "filename"; - symbols = { - modified = " "; - readonly = " "; - }; - separator = {right = "";}; - } - { - "@1" = ""; - draw_empty = true; - separator = { - left = ""; - right = ""; - }; - } - ]; - }; - sections.lualine_c = mkOption { - type = listOf anything; - description = "active config for: | A | B | (C) X | Y | Z |"; - default = [ - { - "@1" = "diff"; - colored = false; - diff_color = { - added = "DiffAdd"; - modified = "DiffChange"; - removed = "DiffDelete"; - }; - symbols = { - added = "+"; - modified = "~"; - removed = "-"; - }; - separator = {right = "";}; - } - ]; - }; - sections.lualine_x = mkOption { - type = listOf anything; - description = "active config for: | A | B | C (X) | Y | Z |"; - default = [ - (mkLuaInline '' + sections = { + lualine_a = mkOption { + type = listOf anything; + description = "active config for: | (A) | B | C X | Y | Z |"; + default = [ + { + "@1" = "mode"; + icons_enabled = true; + separator = { + left = "▎"; + right = ""; + }; + } + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } + ]; + }; + lualine_b = mkOption { + type = listOf anything; + description = "active config for: | A | (B) | C X | Y | Z |"; + default = [ + { + "@1" = "filetype"; + colored = true; + icon_only = true; + icon = {align = "left";}; + } { - -- Lsp server name - function() - local buf_ft = vim.bo.filetype - local excluded_buf_ft = { toggleterm = true, NvimTree = true, ["neo-tree"] = true, TelescopePrompt = true } + "@1" = "filename"; + symbols = { + modified = " "; + readonly = " "; + }; + separator = {right = "";}; + } + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } + ]; + }; + lualine_c = mkOption { + type = listOf anything; + description = "active config for: | A | B | (C) X | Y | Z |"; + default = [ + { + "@1" = "diff"; + colored = false; + diff_color = { + added = "DiffAdd"; + modified = "DiffChange"; + removed = "DiffDelete"; + }; + symbols = { + added = "+"; + modified = "~"; + removed = "-"; + }; + separator = {right = "";}; + } + ]; + }; + lualine_x = mkOption { + type = listOf anything; + description = "active config for: | A | B | C (X) | Y | Z |"; + default = [ + (mkLuaInline '' + { + -- Lsp server name + function() + local buf_ft = vim.bo.filetype + local excluded_buf_ft = { toggleterm = true, NvimTree = true, ["neo-tree"] = true, TelescopePrompt = true } - if excluded_buf_ft[buf_ft] then - return "" - end + if excluded_buf_ft[buf_ft] then + return "" + end - local bufnr = vim.api.nvim_get_current_buf() - local clients = vim.lsp.get_clients({ bufnr = bufnr }) + local bufnr = vim.api.nvim_get_current_buf() + local clients = vim.lsp.get_clients({ bufnr = bufnr }) - if vim.tbl_isempty(clients) then - return "No Active LSP" - end + if vim.tbl_isempty(clients) then + return "No Active LSP" + end - local active_clients = {} - for _, client in ipairs(clients) do - table.insert(active_clients, client.name) - end + local active_clients = {} + for _, client in ipairs(clients) do + table.insert(active_clients, client.name) + end - return table.concat(active_clients, ", ") - end, - icon = " ", - separator = {left = ""}, + return table.concat(active_clients, ", ") + end, + icon = " ", + separator = {left = ""}, + } + '') + { + "@1" = "diagnostics"; + sources = ["nvim_lsp" "nvim_diagnostic" "vim_lsp" "coc"]; + symbols = { + error = "󰅙 "; + warn = " "; + info = " "; + hint = "󰌵 "; + }; + colored = true; + update_in_insert = false; + always_visible = false; + diagnostics_color = { + color_error = {fg = "red";}; + color_warn = {fg = "yellow";}; + color_info = {fg = "cyan";}; + }; } - '') - { - "@1" = "diagnostics"; - sources = ["nvim_lsp" "nvim_diagnostic" "vim_lsp" "coc"]; - symbols = { - error = "󰅙 "; - warn = " "; - info = " "; - hint = "󰌵 "; - }; - colored = true; - update_in_insert = false; - always_visible = false; - diagnostics_color = { - color_error = {fg = "red";}; - color_warn = {fg = "yellow";}; - color_info = {fg = "cyan";}; - }; - } - ]; - }; - sections.lualine_y = mkOption { - type = listOf anything; - description = "active config for: | A | B | C X | (Y) | Z |"; - default = [ - { - "@1" = ""; - draw_empty = true; - separator = { - left = ""; - right = ""; - }; - } - { - "@1" = "t"; - maxcount = 999; - timeout = 120; - separator = {left = "";}; - } - { - "@1" = "branch"; - icon = "•"; - separator = {left = "";}; - } - ]; - }; - sections.lualine_z = mkOption { - type = listOf anything; - description = "active config for: | A | B | C X | Y | (Z) |"; - default = [ - { - "@1" = ""; - draw_empty = true; - separator = { - left = ""; - right = ""; - }; - } - { - "@1" = "progress"; - separator = {left = "";}; - } - ["location"] - { - "@1" = "fileformat"; - color = {fg = "black";}; - symbols = { - unix = ""; - dos = ""; - mac = ""; - }; - } - ]; + ]; + }; + lualine_y = mkOption { + type = listOf anything; + description = "active config for: | A | B | C X | (Y) | Z |"; + default = [ + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } + { + "@1" = "t"; + maxcount = 999; + timeout = 120; + separator = {left = "";}; + } + { + "@1" = "branch"; + icon = "•"; + separator = {left = "";}; + } + ]; + }; + lualine_z = mkOption { + type = listOf anything; + description = "active config for: | A | B | C X | Y | (Z) |"; + default = [ + { + "@1" = ""; + draw_empty = true; + separator = { + left = ""; + right = ""; + }; + } + { + "@1" = "progress"; + separator = {left = "";}; + } + ["location"] + { + "@1" = "fileformat"; + color = {fg = "black";}; + symbols = { + unix = ""; + dos = ""; + mac = ""; + }; + } + ]; + }; }; - inactive_sections.lualine_a = mkOption { - type = listOf anything; - description = "inactive config for: | (A) | B | C X | Y | Z |"; - default = []; - }; - inactive_sections.lualine_b = mkOption { - type = listOf anything; - description = "inactive config for: | A | (B) | C X | Y | Z |"; - default = []; - }; - inactive_sections.lualine_c = mkOption { - type = listOf anything; - description = "inactive config for: | A | B | (C) X | Y | Z |"; - default = ["filename"]; - }; - inactive_sections.lualine_x = mkOption { - type = listOf anything; - description = "inactive config for: | A | B | C (X) | Y | Z |"; - default = ["location"]; - }; - inactive_sections.lualine_y = mkOption { - type = listOf anything; - description = "inactive config for: | A | B | C X | (Y) | Z |"; - default = []; - }; - inactive_sections.lualine_z = mkOption { - type = listOf anything; - description = "inactive config for: | A | B | C X | Y | (Z) |"; - default = []; + inactive_sections = { + lualine_a = mkOption { + type = listOf anything; + description = "inactive config for: | (A) | B | C X | Y | Z |"; + default = []; + }; + lualine_b = mkOption { + type = listOf anything; + description = "inactive config for: | A | (B) | C X | Y | Z |"; + default = []; + }; + lualine_c = mkOption { + type = listOf anything; + description = "inactive config for: | A | B | (C) X | Y | Z |"; + default = ["filename"]; + }; + lualine_x = mkOption { + type = listOf anything; + description = "inactive config for: | A | B | C (X) | Y | Z |"; + default = ["location"]; + }; + lualine_y = mkOption { + type = listOf anything; + description = "inactive config for: | A | B | C X | (Y) | Z |"; + default = []; + }; + lualine_z = mkOption { + type = listOf anything; + description = "inactive config for: | A | B | C X | Y | (Z) |"; + default = []; + }; }; }; From eee6dce674b3bfc9994dc024c5a6b62df89c2a1f Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 4 Sep 2026 03:08:45 +0200 Subject: [PATCH 7/7] docs: unlink removed options --- docs/manual/release-notes/rl-0.6.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/manual/release-notes/rl-0.6.md b/docs/manual/release-notes/rl-0.6.md index ab7b992d3..a3f0ef5af 100644 --- a/docs/manual/release-notes/rl-0.6.md +++ b/docs/manual/release-notes/rl-0.6.md @@ -125,9 +125,9 @@ vim.api.nvim_set_keymap('n', 'a', ':lua camelToSnake()', { noremap = - Lualine module now allows customizing `always_divide_middle`, `ignore_focus` and `disabled_filetypes` through the new options: - {option}`vim.statusline.lualine.alwaysDivideMiddle`, - {option}`vim.statusline.lualine.ignoreFocus` and - {option}`vim.statusline.lualine.disabledFiletypes.statusline`). + `vim.statusline.lualine.alwaysDivideMiddle`, + `vim.statusline.lualine.ignoreFocus` and + `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.