add some modules to statusline

This commit is contained in:
siduck76 2021-06-06 11:05:53 +05:30
parent 39b165a8e5
commit 6f0cabc90b
2 changed files with 39 additions and 14 deletions

View File

@ -17,7 +17,7 @@ cmd "hi PmenuSbar guibg =#353b45"
cmd "hi PmenuThumb guibg =#81A1C1" cmd "hi PmenuThumb guibg =#81A1C1"
-- inactive statuslines as thin splitlines -- inactive statuslines as thin splitlines
cmd("highlight! StatusLineNC gui=underline guifg=#383c44") cmd("hi! StatusLineNC gui=underline guifg=#383c44")
-- line n.o -- line n.o
cmd "hi clear CursorLine" cmd "hi clear CursorLine"

View File

@ -1,16 +1,17 @@
local gl = require("galaxyline") local gl = require("galaxyline")
local gls = gl.section local gls = gl.section
local condition = require("galaxyline.condition")
gl.short_line_list = {" "} gl.short_line_list = {" "}
local colors = { local colors = {
bg = "#22262e", bg = "#22262e",
fg = "#abb2bf", fg = "#abb2bf",
green = "#82ad63", green = "#97C378",
red = "#d47d85", red = "#d47d85",
lightbg = "#2d3139", lightbg = "#2d3139",
lightbg2 = "#262a32", lightbg2 = "#262a32",
blue = "#7797b7", blue = "#81A1C1",
yellow = "#e0c080", yellow = "#e0c080",
grey = "#6f737b" grey = "#6f737b"
} }
@ -29,7 +30,7 @@ gls.left[2] = {
gls.left[3] = { gls.left[3] = {
FileIcon = { FileIcon = {
provider = "FileIcon", provider = "FileIcon",
condition = buffer_not_empty, condition = condition.buffer_not_empty,
highlight = {colors.fg, colors.lightbg} highlight = {colors.fg, colors.lightbg}
} }
} }
@ -37,7 +38,7 @@ gls.left[3] = {
gls.left[4] = { gls.left[4] = {
FileName = { FileName = {
provider = {"FileName"}, provider = {"FileName"},
condition = buffer_not_empty, condition = condition.buffer_not_empty,
highlight = {colors.fg, colors.lightbg}, highlight = {colors.fg, colors.lightbg},
separator = "", separator = "",
separator_highlight = {colors.lightbg, colors.lightbg2} separator_highlight = {colors.lightbg, colors.lightbg2}
@ -108,6 +109,21 @@ gls.left[10] = {
} }
gls.right[1] = { gls.right[1] = {
lsp_status = {
provider = function(msg)
msg = msg or "No Active Lsp"
local clients = vim.lsp.get_active_clients()
if next(clients) ~= nil then
return " " .. "" .. " active "
else
return ""
end
end,
highlight = {colors.grey, colors.bg}
}
}
gls.right[2] = {
GitIcon = { GitIcon = {
provider = function() provider = function()
return "" return ""
@ -119,7 +135,7 @@ gls.right[1] = {
} }
} }
gls.right[2] = { gls.right[3] = {
GitBranch = { GitBranch = {
provider = "GitBranch", provider = "GitBranch",
condition = require("galaxyline.provider_vcs").check_git_workspace, condition = require("galaxyline.provider_vcs").check_git_workspace,
@ -127,7 +143,7 @@ gls.right[2] = {
} }
} }
gls.right[3] = { gls.right[4] = {
viMode_icon = { viMode_icon = {
provider = function() provider = function()
return "" return ""
@ -138,7 +154,7 @@ gls.right[3] = {
} }
} }
gls.right[4] = { gls.right[5] = {
ViMode = { ViMode = {
provider = function() provider = function()
local alias = { local alias = {
@ -162,10 +178,10 @@ gls.right[4] = {
} }
} }
gls.right[5] = { gls.right[6] = {
time_icon = { some_icon = {
provider = function() provider = function()
return " " return " "
end, end,
separator = "", separator = "",
separator_highlight = {colors.green, colors.lightbg}, separator_highlight = {colors.green, colors.lightbg},
@ -173,10 +189,19 @@ gls.right[5] = {
} }
} }
gls.right[6] = { gls.right[7] = {
time = { line_percentage = {
provider = function() provider = function()
return " " .. os.date("%H:%M") .. " " local current_line = vim.fn.line(".")
local total_line = vim.fn.line("$")
if current_line == 1 then
return " Top "
elseif current_line == vim.fn.line("$") then
return " Bot "
end
local result, _ = math.modf((current_line / total_line) * 100)
return " " .. result .. "% "
end, end,
highlight = {colors.green, colors.lightbg} highlight = {colors.green, colors.lightbg}
} }