diff --git a/README.md b/README.md index 6f564db..236c281 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,13 @@ require'lualine'.setup { +If you want to get your current lualine config. you can +do so with +```lua +require'lualine'.get_config() + +``` + --- ### Starting lualine ```lua diff --git a/doc/lualine.txt b/doc/lualine.txt index 63e7933..7125bf6 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -66,6 +66,11 @@ Default config~ extensions = {} } +If you want to get your current lualine config. you can +do so with > + require'lualine'.get_config() + +< ------------------------------------------------------------------------------ STARTING LUALINE *lualine-starting_lualine* *lualine.setup()* > diff --git a/lua/lualine/config.lua b/lua/lualine/config.lua index 0a73890..7aff0ae 100644 --- a/lua/lualine/config.lua +++ b/lua/lualine/config.lua @@ -69,4 +69,11 @@ local function apply_configuration(config_table) return vim.deepcopy(config) end -return {config = vim.deepcopy(config), apply_configuration = apply_configuration} +local function get_current_conifg() + return vim.deepcopy(config) +end + +return { + get_config = get_current_conifg, + apply_configuration = apply_configuration +} diff --git a/lua/lualine/init.lua b/lua/lualine/init.lua index c98b18e..920043c 100644 --- a/lua/lualine/init.lua +++ b/lua/lualine/init.lua @@ -237,4 +237,9 @@ local function setup(user_config) set_tabline() end -return {setup = setup, statusline = status_dispatch, tabline = tabline} +return { + setup = setup, + statusline = status_dispatch, + tabline = tabline, + get_config = config_module.get_config, +}