You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NvChad/lua/statusline.lua

169 lines
3.7 KiB
Lua

4 years ago
local gl = require("galaxyline")
4 years ago
local gls = gl.section
gl.short_line_list = {" "} -- keeping this table { } as empty will show inactive statuslines
4 years ago
local colors = {
bg = "#22262e",
fg = "#abb2bf",
green = "#82ad63",
red = "#d47d85",
lightbg = "#2e323a",
blue = "#7797b7",
yellow = "#e0c080",
grey = "#6f737b"
4 years ago
}
4 years ago
gls.left[2] = {
statusIcon = {
4 years ago
provider = function()
return ""
4 years ago
end,
highlight = {colors.bg, colors.blue},
separator = "",
separator_highlight = {colors.blue, colors.lightbg}
4 years ago
}
4 years ago
}
4 years ago
gls.left[3] = {
FileIcon = {
provider = "FileIcon",
condition = buffer_not_empty,
highlight = {colors.fg, colors.lightbg}
4 years ago
}
4 years ago
}
gls.left[4] = {
4 years ago
FileName = {
provider = {"FileName"},
4 years ago
condition = buffer_not_empty,
highlight = {colors.fg, colors.lightbg},
separator = "",
separator_highlight = {colors.lightbg, colors.bg}
4 years ago
}
4 years ago
}
4 years ago
local checkwidth = function()
4 years ago
local squeeze_width = vim.fn.winwidth(0) / 2
if squeeze_width > 30 then
4 years ago
return true
end
return false
4 years ago
end
gls.left[5] = {
4 years ago
DiffAdd = {
provider = "DiffAdd",
condition = checkwidth,
icon = "",
highlight = {colors.fg, colors.bg}
4 years ago
}
4 years ago
}
gls.left[6] = {
4 years ago
DiffModified = {
provider = "DiffModified",
condition = checkwidth,
icon = "",
highlight = {colors.grey, colors.bg}
4 years ago
}
4 years ago
}
gls.left[7] = {
4 years ago
DiffRemove = {
provider = "DiffRemove",
condition = checkwidth,
icon = "",
highlight = {colors.grey, colors.bg}
4 years ago
}
4 years ago
}
gls.left[8] = {
4 years ago
DiagnosticError = {
provider = "DiagnosticError",
icon = "",
highlight = {colors.grey, colors.bg}
4 years ago
}
4 years ago
}
gls.left[9] = {
4 years ago
DiagnosticWarn = {
provider = "DiagnosticWarn",
icon = "",
highlight = {colors.yellow, colors.bg}
4 years ago
}
4 years ago
}
4 years ago
gls.right[1] = {
4 years ago
GitIcon = {
provider = function()
return ""
4 years ago
end,
condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {colors.grey, colors.lightbg},
separator = "",
separator_highlight = {colors.lightbg, colors.bg}
4 years ago
}
}
gls.right[2] = {
4 years ago
GitBranch = {
provider = "GitBranch",
condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {colors.grey, colors.lightbg}
4 years ago
}
}
gls.right[3] = {
viMode_icon = {
4 years ago
provider = function()
return ""
4 years ago
end,
highlight = {colors.bg, colors.red},
separator = "",
separator_highlight = {colors.red, colors.lightbg}
4 years ago
}
4 years ago
}
gls.right[4] = {
ViMode = {
4 years ago
provider = function()
local alias = {
n = "Normal",
i = "Insert",
c = "Command",
V = "Visual",
[""] = "Visual",
v = "Visual",
R = "Replace"
4 years ago
}
local current_Mode = alias[vim.fn.mode()]
if current_Mode ~= nil then
return " " .. current_Mode .. " "
end
4 years ago
end,
highlight = {colors.red, colors.lightbg}
4 years ago
}
4 years ago
}
gls.right[5] = {
time_icon = {
provider = function()
return ""
end,
separator = "",
separator_highlight = {colors.green, colors.bg},
highlight = {colors.lightbg, colors.green}
4 years ago
}
4 years ago
}
4 years ago
gls.right[6] = {
time = {
4 years ago
provider = function()
return " " .. os.date("%H:%M") .. " "
4 years ago
end,
highlight = {colors.green, colors.lightbg}
4 years ago
}
4 years ago
}