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,6 +14,7 @@
"dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" },
"friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" },
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
"gruvbox-baby": { "branch": "main", "commit": "ea71b4225d0140103d99748ca4a33ecf22c03f62" },
"impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" },
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
"jaq-nvim": { "branch": "master", "commit": "236296aae555657487d1bb4d066cbde9d79d8cd4" },
@ -36,7 +37,7 @@
"nvim-lsp-installer": { "branch": "main", "commit": "17e0bfa5f2c8854d1636fcd036dc8284db136baa" },
"nvim-lspconfig": { "branch": "master", "commit": "255e07ce2a05627d482d2de77308bba51b90470c" },
"nvim-material-icon": { "branch": "main", "commit": "602088c2682e61cbebd7191de7dc88bfa90c6890" },
"nvim-navic": { "branch": "master", "commit": "7e9d2b2b601149fecdccd11b516acb721e571fe6" },
"nvim-navic": { "branch": "master", "commit": "cdd24539bcf114a499827e9b32869fe74836efe7" },
"nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" },
"nvim-scrollview": { "branch": "main", "commit": "ba6c48bf7919dd48a371e7b9c683b8858053e885" },
"nvim-tree.lua": { "branch": "master", "commit": "1b453441f4b1a501a6251db4138cf67172d0d5d2" },
@ -51,7 +52,6 @@
"telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" },
"todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" },
"toggleterm.nvim": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" },
"tokyonight.nvim": { "branch": "main", "commit": "57ed37148ffcf05d68df8e06d4eec2b74bf62601" },
"trouble.nvim": { "branch": "main", "commit": "67337644e38144b444d026b0df2dc5fa0038930f" },
"vim-bbye": { "branch": "master", "commit": "903f5eb17f72ebf7b0b1524bbb792c0b36761af6" },
"vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" },

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