Skip to content

Dynamically add sections? #1017

Answered by yutkat
twiddli asked this question in Q&A
Apr 16, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Yes. It is no problem to call .setup more than once.

vim.keymap.set({ "n" }, "!", function()
	local lualine_require = require("lualine_require")
	local modules = lualine_require.lazy_require({ config_module = "lualine.config" })

	local current_config = modules.config_module.get_config()
    -- Edit here
	current_config.sections.lualine_a = { "hostname" }
	require("lualine").setup(current_config)
end, { noremap = true, expr = true })

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@twiddli
Comment options

Answer selected by twiddli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants