make statusline more pretty

This commit is contained in:
siduck76 2021-08-19 17:35:24 +05:30
parent 7244492b36
commit 5ae6fba20d
3 changed files with 50 additions and 20 deletions

View File

@ -21,7 +21,7 @@ M.ui = {
"NvimTree", "NvimTree",
-- "terminal", -- "terminal",
}, },
statusline_style = "default", -- round , slant , block statusline_style = "default", -- default, round , slant , block , arrow
} }
M.options = { M.options = {

View File

@ -21,7 +21,7 @@ M.ui = {
"NvimTree", "NvimTree",
"terminal", "terminal",
}, },
statusline_style = "default", -- round , slant , block statusline_style = "default", -- default, round , slant , block , arrow
} }
M.options = { M.options = {

View File

@ -43,6 +43,14 @@ local icon_styles = {
vi_mode_icon = "", vi_mode_icon = "",
position_icon = "", position_icon = "",
}, },
arrow = {
left = "",
right = "",
main_icon = "",
vi_mode_icon = "",
position_icon = "",
},
} }
local user_statusline_style = require("utils").load_config().ui.statusline_style local user_statusline_style = require("utils").load_config().ui.statusline_style
@ -66,12 +74,20 @@ gls.left[2] = {
return statusline_style.main_icon return statusline_style.main_icon
end, end,
highlight = { colors.statusline_bg, colors.nord_blue }, highlight = { colors.statusline_bg, colors.nord_blue },
separator = right_separator .. " ", separator = right_separator,
separator_highlight = { colors.nord_blue, colors.lightbg }, separator_highlight = { colors.nord_blue, colors.one_bg2 },
}, },
} }
gls.left[3] = { gls.left[3] = {
left_arow2 = {
provider = function() end,
separator = right_separator .. " ",
separator_highlight = { colors.one_bg2, colors.lightbg },
},
}
gls.left[4] = {
FileIcon = { FileIcon = {
provider = "FileIcon", provider = "FileIcon",
condition = condition.buffer_not_empty, condition = condition.buffer_not_empty,
@ -79,7 +95,7 @@ gls.left[3] = {
}, },
} }
gls.left[4] = { gls.left[5] = {
FileName = { FileName = {
provider = function() provider = function()
local fileinfo = require "galaxyline.provider_fileinfo" local fileinfo = require "galaxyline.provider_fileinfo"
@ -92,7 +108,7 @@ gls.left[4] = {
}, },
} }
gls.left[5] = { gls.left[6] = {
current_dir = { current_dir = {
provider = function() provider = function()
local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
@ -112,7 +128,7 @@ local checkwidth = function()
return false return false
end end
gls.left[6] = { gls.left[7] = {
DiffAdd = { DiffAdd = {
provider = "DiffAdd", provider = "DiffAdd",
condition = checkwidth, condition = checkwidth,
@ -121,7 +137,7 @@ gls.left[6] = {
}, },
} }
gls.left[7] = { gls.left[8] = {
DiffModified = { DiffModified = {
provider = "DiffModified", provider = "DiffModified",
condition = checkwidth, condition = checkwidth,
@ -130,7 +146,7 @@ gls.left[7] = {
}, },
} }
gls.left[8] = { gls.left[9] = {
DiffRemove = { DiffRemove = {
provider = "DiffRemove", provider = "DiffRemove",
condition = checkwidth, condition = checkwidth,
@ -139,7 +155,7 @@ gls.left[8] = {
}, },
} }
gls.left[9] = { gls.left[10] = {
DiagnosticError = { DiagnosticError = {
provider = "DiagnosticError", provider = "DiagnosticError",
icon = "", icon = "",
@ -147,7 +163,7 @@ gls.left[9] = {
}, },
} }
gls.left[10] = { gls.left[11] = {
DiagnosticWarn = { DiagnosticWarn = {
provider = "DiagnosticWarn", provider = "DiagnosticWarn",
icon = "", icon = "",
@ -214,18 +230,24 @@ local mode = function(n)
end end
gls.right[4] = { gls.right[4] = {
left_arrow = {
provider = function() end,
separator = " " .. left_separator,
separator_highlight = { colors.one_bg2, colors.statusline_bg },
},
}
gls.right[5] = {
left_round = { left_round = {
provider = function() provider = function()
vim.cmd("hi Galaxyleft_round guifg=" .. mode(2)) vim.cmd("hi Galaxyleft_round guifg=" .. mode(2))
return left_separator return left_separator
end, end,
separator = " ", highlight = { "GalaxyViMode", colors.one_bg2 },
separator_highlight = { colors.statusline_bg, colors.statusline_bg },
highlight = { "GalaxyViMode", colors.statusline_bg },
}, },
} }
gls.right[5] = { gls.right[6] = {
viMode_icon = { viMode_icon = {
provider = function() provider = function()
vim.cmd("hi GalaxyviMode_icon guibg=" .. mode(2)) vim.cmd("hi GalaxyviMode_icon guibg=" .. mode(2))
@ -235,7 +257,7 @@ gls.right[5] = {
}, },
} }
gls.right[6] = { gls.right[7] = {
ViMode = { ViMode = {
provider = function() provider = function()
vim.cmd("hi GalaxyViMode guifg=" .. mode(2)) vim.cmd("hi GalaxyViMode guifg=" .. mode(2))
@ -245,18 +267,26 @@ gls.right[6] = {
}, },
} }
gls.right[7] = { gls.right[8] = {
left_arrow2 = {
provider = function() end,
separator = left_separator,
separator_highlight = { colors.grey, colors.lightbg },
},
}
gls.right[9] = {
some_RoundIcon = { some_RoundIcon = {
provider = function() provider = function()
return statusline_style.position_icon return statusline_style.position_icon
end, end,
separator = left_separator, separator = left_separator,
separator_highlight = { colors.green, colors.lightbg }, separator_highlight = { colors.green, colors.grey },
highlight = { colors.lightbg, colors.green }, highlight = { colors.lightbg, colors.green },
}, },
} }
gls.right[8] = { gls.right[10] = {
line_percentage = { line_percentage = {
provider = function() provider = function()
local current_line = vim.fn.line "." local current_line = vim.fn.line "."