From 85fe093efb8353552171575809c02a5e9124fa68 Mon Sep 17 00:00:00 2001 From: chaeing Date: Fri, 20 Aug 2021 02:16:29 -0700 Subject: [Feature] switch galaxyline to lualine (#1329) --- lua/core/lualine/utils.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lua/core/lualine/utils.lua (limited to 'lua/core/lualine/utils.lua') diff --git a/lua/core/lualine/utils.lua b/lua/core/lualine/utils.lua new file mode 100644 index 00000000..f2f29592 --- /dev/null +++ b/lua/core/lualine/utils.lua @@ -0,0 +1,24 @@ +local M = {} + +function M.validate_theme() + local theme = lvim.builtin.lualine.options.theme + + local lualine_loader = require "lualine.utils.loader" + local ok = pcall(lualine_loader.load_theme, theme) + if not ok then + lvim.builtin.lualine.options.theme = "auto" + end +end + +function M.env_cleanup(venv) + if string.find(venv, "/") then + local final_venv = venv + for w in venv:gmatch "([^/]+)" do + final_venv = w + end + venv = final_venv + end + return venv +end + +return M -- cgit v1.2.3 From 378c1c3eb5f32da7057371fedda405250ccb67c8 Mon Sep 17 00:00:00 2001 From: chaeing Date: Mon, 23 Aug 2021 23:49:18 -0700 Subject: [Feature] enhance lualine config (#1372) --- lua/core/lualine/utils.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lua/core/lualine/utils.lua') diff --git a/lua/core/lualine/utils.lua b/lua/core/lualine/utils.lua index f2f29592..cf80a99e 100644 --- a/lua/core/lualine/utils.lua +++ b/lua/core/lualine/utils.lua @@ -2,6 +2,9 @@ local M = {} function M.validate_theme() local theme = lvim.builtin.lualine.options.theme + if type(theme) == "table" then + return + end local lualine_loader = require "lualine.utils.loader" local ok = pcall(lualine_loader.load_theme, theme) -- cgit v1.2.3