fitur baru custom lualine style

This commit is contained in:
asep komarudin 2023-03-04 09:44:58 +07:00
parent 1c107be959
commit 06995762e0
3 changed files with 49 additions and 13 deletions

View file

@ -45,7 +45,7 @@
"nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-web-devicons": { "branch": "master", "commit": "c2c2317f356c8b7da0252f5da758f71bb60bb6b2" },
"nvim-web-devicons": { "branch": "master", "commit": "c3c1dc4e36969370ff589b7025df8ec2e5c881a2" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"smart-splits.nvim": { "branch": "master", "commit": "52b521618511b3a874255c8a717ace7155fd5f21" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },

View file

@ -3,4 +3,15 @@ local m = {}
-- 1 lualine lsp progress
-- 2 fidget progress
m.progress = 1
-- style
-- 0 = default
-- 1 = { left = "", right = "" },
-- 2 = { left = " ", right = " " },
-- 3 = { left = "", right = "" },
m.lualine_style = 0
-- style status icon
-- 0 = default
-- 1 = vim icon " "
-- 2 = vim icon " "
m.status_icon = 0
return m

View file

@ -47,12 +47,44 @@ local diff = {
cond = hide_in_width,
}
-- for config style
local component_separators = { left = "", right = "" }
local section_separators = { left = "", right = "" }
local icon_mode = ""
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 = "" }
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
end
end
end
local mode = {
"mode",
fmt = function(str)
if sts_mode == 0 then
return "--" .. str .. "--"
-- return " " .. str
-- return " " .. str
else
return icon_mode .. str
end
end,
}
@ -180,15 +212,8 @@ lualine.setup({
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "", right = "" },
-- component_separators = { left = "", right = "" },
-- section_separators = { left = " ", right = " " },
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "", right = "" },
component_separators = component_separators,
section_separators = section_separators,
disabled_filetypes = {
"TelescopePrompt",
"packer",