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 | dff4fa5bed7ffa205af5a4c9b5fdf4fdee53e1c5 (patch) | |
| tree | 5f04e173ca2fafc90134e4a0f198b77f418d4337 | |
| parent | 0680129a517e7dea3e41853e37fa1e4de8ceded7 (diff) | |
| download | dotfiles-dff4fa5bed7ffa205af5a4c9b5fdf4fdee53e1c5.tar.gz dotfiles-dff4fa5bed7ffa205af5a4c9b5fdf4fdee53e1c5.zip | |
refactor(nvim): deduplicate lualine setup
| -rw-r--r-- | .config/nvim/plugin/50-statusline.lua | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/.config/nvim/plugin/50-statusline.lua b/.config/nvim/plugin/50-statusline.lua index eea1291..e1d1687 100644 --- a/.config/nvim/plugin/50-statusline.lua +++ b/.config/nvim/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() |
