default_config : add statusline separators style

This commit is contained in:
siduck76 2021-08-19 11:59:42 +05:30
parent 88ff5595ad
commit 623a2a0d1a
2 changed files with 46 additions and 8 deletions

View file

@ -13,8 +13,9 @@ M.ui = {
hidden_statusline = { hidden_statusline = {
-- these are filetypes, not pattern matched -- these are filetypes, not pattern matched
"NvimTree", "NvimTree",
-- "terminal", "terminal",
}, },
statusline_style = "default", -- round , slant , block
} }
M.options = { M.options = {

View file

@ -1,3 +1,6 @@
local global_theme = "themes/" .. vim.g.nvchad_theme
local colors = require(global_theme)
local present1, gl = pcall(require, "galaxyline") local present1, gl = pcall(require, "galaxyline")
local present2, condition = pcall(require, "galaxyline.condition") local present2, condition = pcall(require, "galaxyline.condition")
if not (present1 or present2) then if not (present1 or present2) then
@ -8,11 +11,45 @@ local gls = gl.section
gl.short_line_list = { " " } gl.short_line_list = { " " }
local left_separator = "" -- or " " local icon_styles = {
local right_separator = "" -- or "" default = {
left = "",
right = "",
main_icon = "",
vi_mode_icon = "",
position_icon = "",
},
local global_theme = "themes/" .. vim.g.nvchad_theme round = {
local colors = require(global_theme) left = "",
right = "",
main_icon = "",
vi_mode_icon = "",
position_icon = "",
},
slant = {
left = "",
right = "",
main_icon = "",
vi_mode_icon = "",
position_icon = "",
},
block = {
left = " ",
right = " ",
main_icon = "",
vi_mode_icon = "",
position_icon = "",
},
}
local user_statusline_style = require("chadrc").ui.statusline_style
local statusline_style = icon_styles[user_statusline_style]
local left_separator = statusline_style.left
local right_separator = statusline_style.right
gls.left[1] = { gls.left[1] = {
FirstElement = { FirstElement = {
@ -26,7 +63,7 @@ gls.left[1] = {
gls.left[2] = { gls.left[2] = {
statusIcon = { statusIcon = {
provider = function() provider = function()
return "" 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 .. " ",
@ -192,7 +229,7 @@ gls.right[5] = {
viMode_icon = { viMode_icon = {
provider = function() provider = function()
vim.cmd("hi GalaxyviMode_icon guibg=" .. mode(2)) vim.cmd("hi GalaxyviMode_icon guibg=" .. mode(2))
return "" return statusline_style.vi_mode_icon
end, end,
highlight = { colors.statusline_bg, colors.red }, highlight = { colors.statusline_bg, colors.red },
}, },
@ -211,7 +248,7 @@ gls.right[6] = {
gls.right[7] = { gls.right[7] = {
some_RoundIcon = { some_RoundIcon = {
provider = function() provider = function()
return "" return statusline_style.position_icon
end, end,
separator = left_separator, separator = left_separator,
separator_highlight = { colors.green, colors.lightbg }, separator_highlight = { colors.green, colors.lightbg },