support custom lualine style

This commit is contained in:
asep komarudin 2023-03-04 14:00:51 +07:00
parent 1bb9a4cfa2
commit 751268cb45
3 changed files with 60 additions and 19 deletions

View file

@ -14,9 +14,36 @@ m.lualine_style = 0
-- 1 = vim icon " "
-- 2 = vim icon " "
m.status_icon = 0
-- start custom lualine style
-- contoh style
-- {
-- { left = "│", right = "│" },
-- { left = " ", right = " " },
-- },
-- {
-- { left = " ", right = " " },
-- { left = " ", right = "" },
-- },
-- {
-- { left = " ", right = " " },
-- { left = "", right = "" },
-- },
-- {
-- { left = "", right = "" },
-- { left = "", right = "" },
-- },
-- {
-- { left = " ", right = " " },
-- { left = "", right = "" },
-- },
-- }
m.custom_lualine = false
m.component_separators = { left = " ", right = " " }
m.section_separators = { left = "", right = "" }
-- end custom lualine style
-- custom colorscheme
-- colorscheme ready :
-- tokyonight
-- tokyonight-night
-- tokyonight-storm

View file

@ -56,23 +56,37 @@ local sts_mode = 0
local data_exists, custom_ui = pcall(require, "custom.ui")
if data_exists then
if type(custom_ui) == "table" then
if custom_ui.lualine_style == 1 then
component_separators = { left = "", right = "" }
section_separators = { left = "", right = "" }
elseif custom_ui.lualine_style == 2 then
component_separators = { left = "", right = "" }
section_separators = { left = "", right = "" }
elseif custom_ui.lualine_style == 3 then
component_separators = { left = "", right = "" }
section_separators = { left = "", right = "" }
local ui_style = custom_ui.lualine_style
if ui_style ~= nil then
if custom_ui.lualine_style == 1 then
component_separators = { left = "", right = "" }
section_separators = { left = "", right = "" }
elseif custom_ui.lualine_style == 2 then
component_separators = { left = "", right = "" }
section_separators = { left = "", right = "" }
elseif custom_ui.lualine_style == 3 then
component_separators = { left = "", right = "" }
section_separators = { left = "", right = "" }
end
end
if custom_ui.status_icon == 1 then
icon_mode = ""
sts_mode = 1
elseif custom_ui.status_icon == 2 then
icon_mode = ""
sts_mode = 1
local ui_icon = custom_ui.status_icon
if ui_icon ~= nil then
if custom_ui.status_icon == 1 then
icon_mode = ""
sts_mode = 1
elseif custom_ui.status_icon == 2 then
icon_mode = ""
sts_mode = 1
end
end
local custom_style = custom_ui.custom_lualine
if custom_style ~= nil and custom_style == true then
local comp = custom_ui.component_separators
local section = custom_ui.section_separators
if comp ~= nil and section ~= nil then
component_separators = comp
section_separators = section
end
end
end
end