made statusline prettier!

This commit is contained in:
siduck76 2021-05-25 08:01:14 +05:30
parent de05895c28
commit 7ab882bfa8
1 changed files with 69 additions and 103 deletions

View File

@ -1,27 +1,17 @@
local gl = require("galaxyline") local gl = require("galaxyline")
local gls = gl.section local gls = gl.section
gl.short_line_list = {" "} -- keeping this table { } as empty will show inactive statuslines gl.short_line_list = {"defx", "vista", "dbui", "vista_markdown", "packer"}
local colors = { local colors = {
bg = "#1e222a", bg = "#22262e",
line_bg = "#1e222a", fg = "#abb2bf",
fg = "#D8DEE9", green = "#82ad63",
green = "#BBE67E", red = "#d47d85",
orange = "#FF8800", lightbg = "#2e323a",
red = "#DF8890", blue = "#7797b7",
lightbg = "#282c34", yellow = "#e0c080",
nord = "#81A1C1", grey = "#6f737b"
greenYel = "#EBCB8B"
}
gls.left[1] = {
leftRounded = {
provider = function()
return ""
end,
highlight = {colors.nord, colors.bg}
}
} }
gls.left[2] = { gls.left[2] = {
@ -29,9 +19,9 @@ gls.left[2] = {
provider = function() provider = function()
return "" return ""
end, end,
highlight = {colors.bg, colors.nord}, highlight = {colors.bg, colors.blue},
separator = " ", separator = " ",
separator_highlight = {colors.lightbg, colors.lightbg} separator_highlight = {colors.blue, colors.lightbg}
} }
} }
@ -39,96 +29,68 @@ gls.left[3] = {
FileIcon = { FileIcon = {
provider = "FileIcon", provider = "FileIcon",
condition = buffer_not_empty, condition = buffer_not_empty,
highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.lightbg} highlight = {colors.fg, colors.lightbg}
} }
} }
gls.left[4] = { gls.left[4] = {
FileName = { FileName = {
provider = {"FileName", "FileSize"}, provider = {"FileName"},
condition = buffer_not_empty, condition = buffer_not_empty,
highlight = {colors.fg, colors.lightbg} highlight = {colors.fg, colors.lightbg},
} separator = "",
} separator_highlight = {colors.lightbg, colors.bg}
gls.left[5] = {
teech = {
provider = function()
return ""
end,
separator = " ",
highlight = {colors.lightbg, colors.bg}
} }
} }
local checkwidth = function() local checkwidth = function()
local squeeze_width = vim.fn.winwidth(0) / 2 local squeeze_width = vim.fn.winwidth(0) / 2
if squeeze_width > 40 then if squeeze_width > 30 then
return true return true
end end
return false return false
end end
gls.left[6] = { gls.left[5] = {
DiffAdd = { DiffAdd = {
provider = "DiffAdd", provider = "DiffAdd",
condition = checkwidth, condition = checkwidth,
icon = "", icon = "",
highlight = {colors.greenYel, colors.line_bg} highlight = {colors.fg, colors.bg}
} }
} }
gls.left[7] = { gls.left[6] = {
DiffModified = { DiffModified = {
provider = "DiffModified", provider = "DiffModified",
condition = checkwidth, condition = checkwidth,
icon = "", icon = "",
highlight = {colors.orange, colors.line_bg} highlight = {colors.grey, colors.bg}
}
}
gls.left[7] = {
DiffRemove = {
provider = "DiffRemove",
condition = checkwidth,
icon = "",
highlight = {colors.grey, colors.bg}
} }
} }
gls.left[8] = { gls.left[8] = {
DiffRemove = { DiagnosticError = {
provider = "DiffRemove", provider = "DiagnosticError",
condition = checkwidth, icon = "",
icon = "", highlight = {colors.grey, colors.bg}
highlight = {colors.red, colors.line_bg}
} }
} }
gls.left[9] = { gls.left[9] = {
LeftEnd = {
provider = function()
return " "
end,
separator = " ",
separator_highlight = {colors.line_bg, colors.line_bg},
highlight = {colors.line_bg, colors.line_bg}
}
}
gls.left[10] = {
DiagnosticError = {
provider = "DiagnosticError",
icon = "",
highlight = {colors.red, colors.bg}
}
}
gls.left[11] = {
Space = {
provider = function()
return " "
end,
highlight = {colors.line_bg, colors.line_bg}
}
}
gls.left[12] = {
DiagnosticWarn = { DiagnosticWarn = {
provider = "DiagnosticWarn", provider = "DiagnosticWarn",
icon = "", icon = "",
highlight = {colors.red, colors.bg} highlight = {colors.yellow, colors.bg}
} }
} }
@ -138,7 +100,9 @@ gls.right[1] = {
return "" return ""
end, end,
condition = require("galaxyline.provider_vcs").check_git_workspace, condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {colors.green, colors.line_bg} highlight = {colors.grey, colors.lightbg},
separator = "",
separator_highlight = {colors.lightbg, colors.bg}
} }
} }
@ -146,18 +110,18 @@ gls.right[2] = {
GitBranch = { GitBranch = {
provider = "GitBranch", provider = "GitBranch",
condition = require("galaxyline.provider_vcs").check_git_workspace, condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {colors.green, colors.line_bg} highlight = {colors.grey, colors.lightbg}
} }
} }
gls.right[3] = { gls.right[3] = {
right_LeftRounded = { viMode_icon = {
provider = function() provider = function()
return "" return ""
end, end,
separator = " ", highlight = {colors.bg, colors.red},
separator_highlight = {colors.bg, colors.bg}, separator = "",
highlight = {colors.red, colors.bg} separator_highlight = {colors.red, colors.lightbg}
} }
} }
@ -165,34 +129,36 @@ gls.right[4] = {
ViMode = { ViMode = {
provider = function() provider = function()
local alias = { local alias = {
n = "NORMAL", n = "Normal",
i = "INSERT", i = "Insert",
c = "COMMAND", c = "Command",
V = "VISUAL", V = "Visual",
[""] = "VISUAL", [""] = "Visual",
v = "VISUAL", v = "Visual",
R = "REPLACE" R = "Replace"
} }
return alias[vim.fn.mode()] return " " .. alias[vim.fn.mode()] .. " "
end, end,
highlight = {colors.bg, colors.red} highlight = {colors.red, colors.lightbg}
} }
} }
gls.right[5] = { gls.right[5] = {
PerCent = { time_icon = {
provider = "LinePercent", provider = function()
separator = " ", return ""
separator_highlight = {colors.red, colors.red}, end,
highlight = {colors.bg, colors.fg} separator = "",
separator_highlight = {colors.green, colors.bg},
highlight = {colors.lightbg, colors.green}
} }
} }
gls.right[6] = { gls.right[6] = {
rightRounded = { time = {
provider = function() provider = function()
return "" return " " .. os.date("%H:%M") .. " "
end, end,
highlight = {colors.fg, colors.bg} highlight = {colors.green, colors.lightbg}
} }
} }