nvim-lualine/lualine.nvim

Feat: Access "auto" theme through require("lualine.themes.auto")

etiennecollin opened this issue · 1 comments

Requested feature

Have access to the "auto" theme through require("lualine.themes.auto") such that we can modify it. For example:

local custom_theme = require("lualine.themes.auto")
custom_theme.normal.c.bg = "None"
require("lualine").setup({
	options = {
		theme = custom_theme,
	},
})

Motivation

The "auto" theme is great to use when switching colorschemes regularly. That being said, most of the lualine themes do not feature a transparent background even though their corresponding colorscheme has/supports it (tested with tokyonight and sonokai on iterm2 with transparent background activated).

Usually, I would do the following to add a transparent background to lualine:

local custom_theme = require("lualine.themes.<the_specific_colorscheme_name>")
custom_theme.normal.c.bg = "None"
require("lualine").setup({
	options = {
		theme = custom_theme,
	},
})

But this requires changing the parameter <the_specific_colorscheme_name> every time we change colorscheme. I believe it would be great to be able to do:

local custom_theme = require("lualine.themes.auto")
custom_theme.normal.c.bg = "None"
require("lualine").setup({
	options = {
		theme = custom_theme,
	},
})

Where the lualine.themes.auto gets the "auto" theme such that we are able to modify some of its values. In this case, that means no matter the colorscheme selected, its corresponding lualine theme will always have its value normal.c.bg = "None".

I am terribly sorry, I just realized I had an issue with plugin load order because of lazy-loading.

The lualine plugin was loading before my theme. Hence, require("lualine.themes.auto") was executed, but couldn't find the theme. That's why it seemed like it didn't work.

I will close this issue.
Thank you for the amazing plugin!