diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-02 20:41:23 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-02 20:41:23 +0200 |
| commit | fb6d11d4f04b20d2c5cd2a8fb5e307400c18659c (patch) | |
| tree | 243a131b45ecd996f62806082cd30ca1f4592d4e /plugin | |
| parent | 4d6e745c815fce7361531a1ae575cc9ccf6f590d (diff) | |
| download | nvim-config-fb6d11d4f04b20d2c5cd2a8fb5e307400c18659c.tar.gz nvim-config-fb6d11d4f04b20d2c5cd2a8fb5e307400c18659c.zip | |
refactor(nvim): deduplicate lualine setup
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/50-statusline.lua | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/plugin/50-statusline.lua b/plugin/50-statusline.lua index eea1291..e1d1687 100644 --- a/plugin/50-statusline.lua +++ b/plugin/50-statusline.lua @@ -45,28 +45,29 @@ local lualine_sections = { lualine_x = { "encoding", "fileformat", "filetype", "lsp_status" }, } +local lualine_options = { + disabled_filetypes = { "netrw", "qf" }, + component_separators = { left = "|", right = "|" }, + section_separators = { left = "", right = "" }, +} + +local function setup() + lualine_options.theme = vim.o.background == "light" and "solarized_light" or "solarized_dark" + lualine.setup({ options = lualine_options, sections = lualine_sections }) +end + -- Adjust colors when the theme (light/dark) changes vim.api.nvim_create_autocmd("OptionSet", { desc = "Adjust color scheme", pattern = "background", group = vim.g.dotfiles.augroup, callback = function() - lualine.setup({ - options = { - theme = vim.o.background == "light" and "solarized_light" or "solarized_dark", - disabled_filetypes = { "netrw", "qf" }, - component_separators = { left = "|", right = "|" }, - section_separators = { left = "", right = "" }, - }, - }) + setup() vim.schedule(bold_diff_diag) end, }) -lualine.setup({ - options = { theme = vim.o.background == "light" and "solarized_light" or "solarized_dark" }, - sections = lualine_sections, -}) +setup() vim.schedule(bold_diff_diag) vim.api.nvim_create_user_command("LualineConfig", function() |
