|
|
@ -1,25 +1,32 @@
|
|
|
|
local M = {}
|
|
|
|
local gl, condition
|
|
|
|
|
|
|
|
if
|
|
|
|
|
|
|
|
not pcall(
|
|
|
|
|
|
|
|
function()
|
|
|
|
|
|
|
|
gl = require "galaxyline"
|
|
|
|
|
|
|
|
condition = require "galaxyline.condition"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
M.config = function()
|
|
|
|
local gls = gl.section
|
|
|
|
local gl = require("galaxyline")
|
|
|
|
|
|
|
|
local gls = gl.section
|
|
|
|
|
|
|
|
local condition = require("galaxyline.condition")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gl.short_line_list = {" "}
|
|
|
|
gl.short_line_list = {" "}
|
|
|
|
|
|
|
|
|
|
|
|
local global_theme = "themes/" .. vim.g.nvchad_theme
|
|
|
|
local global_theme = "themes/" .. vim.g.nvchad_theme
|
|
|
|
local colors = require(global_theme)
|
|
|
|
local colors = require(global_theme)
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[1] = {
|
|
|
|
gls.left[1] = {
|
|
|
|
FirstElement = {
|
|
|
|
FirstElement = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
return "▋"
|
|
|
|
return "▋"
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
highlight = {colors.nord_blue, colors.nord_blue}
|
|
|
|
highlight = {colors.nord_blue, colors.nord_blue}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[2] = {
|
|
|
|
gls.left[2] = {
|
|
|
|
statusIcon = {
|
|
|
|
statusIcon = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
return " "
|
|
|
|
return " "
|
|
|
@ -28,17 +35,17 @@ M.config = function()
|
|
|
|
separator = " ",
|
|
|
|
separator = " ",
|
|
|
|
separator_highlight = {colors.nord_blue, colors.lightbg}
|
|
|
|
separator_highlight = {colors.nord_blue, colors.lightbg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[3] = {
|
|
|
|
gls.left[3] = {
|
|
|
|
FileIcon = {
|
|
|
|
FileIcon = {
|
|
|
|
provider = "FileIcon",
|
|
|
|
provider = "FileIcon",
|
|
|
|
condition = condition.buffer_not_empty,
|
|
|
|
condition = condition.buffer_not_empty,
|
|
|
|
highlight = {colors.white, colors.lightbg}
|
|
|
|
highlight = {colors.white, colors.lightbg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[4] = {
|
|
|
|
gls.left[4] = {
|
|
|
|
FileName = {
|
|
|
|
FileName = {
|
|
|
|
provider = {"FileName"},
|
|
|
|
provider = {"FileName"},
|
|
|
|
condition = condition.buffer_not_empty,
|
|
|
|
condition = condition.buffer_not_empty,
|
|
|
@ -46,9 +53,9 @@ M.config = function()
|
|
|
|
separator = " ",
|
|
|
|
separator = " ",
|
|
|
|
separator_highlight = {colors.lightbg, colors.lightbg2}
|
|
|
|
separator_highlight = {colors.lightbg, colors.lightbg2}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[5] = {
|
|
|
|
gls.left[5] = {
|
|
|
|
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")
|
|
|
@ -58,60 +65,60 @@ M.config = function()
|
|
|
|
separator = " ",
|
|
|
|
separator = " ",
|
|
|
|
separator_highlight = {colors.lightbg2, colors.statusline_bg}
|
|
|
|
separator_highlight = {colors.lightbg2, colors.statusline_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 > 30 then
|
|
|
|
if squeeze_width > 30 then
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[6] = {
|
|
|
|
gls.left[6] = {
|
|
|
|
DiffAdd = {
|
|
|
|
DiffAdd = {
|
|
|
|
provider = "DiffAdd",
|
|
|
|
provider = "DiffAdd",
|
|
|
|
condition = checkwidth,
|
|
|
|
condition = checkwidth,
|
|
|
|
icon = " ",
|
|
|
|
icon = " ",
|
|
|
|
highlight = {colors.white, colors.statusline_bg}
|
|
|
|
highlight = {colors.white, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[7] = {
|
|
|
|
gls.left[7] = {
|
|
|
|
DiffModified = {
|
|
|
|
DiffModified = {
|
|
|
|
provider = "DiffModified",
|
|
|
|
provider = "DiffModified",
|
|
|
|
condition = checkwidth,
|
|
|
|
condition = checkwidth,
|
|
|
|
icon = " ",
|
|
|
|
icon = " ",
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[8] = {
|
|
|
|
gls.left[8] = {
|
|
|
|
DiffRemove = {
|
|
|
|
DiffRemove = {
|
|
|
|
provider = "DiffRemove",
|
|
|
|
provider = "DiffRemove",
|
|
|
|
condition = checkwidth,
|
|
|
|
condition = checkwidth,
|
|
|
|
icon = " ",
|
|
|
|
icon = " ",
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[9] = {
|
|
|
|
gls.left[9] = {
|
|
|
|
DiagnosticError = {
|
|
|
|
DiagnosticError = {
|
|
|
|
provider = "DiagnosticError",
|
|
|
|
provider = "DiagnosticError",
|
|
|
|
icon = " ",
|
|
|
|
icon = " ",
|
|
|
|
highlight = {colors.red, colors.statusline_bg}
|
|
|
|
highlight = {colors.red, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.left[10] = {
|
|
|
|
gls.left[10] = {
|
|
|
|
DiagnosticWarn = {
|
|
|
|
DiagnosticWarn = {
|
|
|
|
provider = "DiagnosticWarn",
|
|
|
|
provider = "DiagnosticWarn",
|
|
|
|
icon = " ",
|
|
|
|
icon = " ",
|
|
|
|
highlight = {colors.yellow, colors.statusline_bg}
|
|
|
|
highlight = {colors.yellow, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.right[1] = {
|
|
|
|
gls.right[1] = {
|
|
|
|
lsp_status = {
|
|
|
|
lsp_status = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
local clients = vim.lsp.get_active_clients()
|
|
|
|
local clients = vim.lsp.get_active_clients()
|
|
|
@ -123,9 +130,9 @@ M.config = function()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.right[2] = {
|
|
|
|
gls.right[2] = {
|
|
|
|
GitIcon = {
|
|
|
|
GitIcon = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
return " "
|
|
|
|
return " "
|
|
|
@ -135,17 +142,17 @@ M.config = function()
|
|
|
|
separator = " ",
|
|
|
|
separator = " ",
|
|
|
|
separator_highlight = {colors.statusline_bg, colors.statusline_bg}
|
|
|
|
separator_highlight = {colors.statusline_bg, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.right[3] = {
|
|
|
|
gls.right[3] = {
|
|
|
|
GitBranch = {
|
|
|
|
GitBranch = {
|
|
|
|
provider = "GitBranch",
|
|
|
|
provider = "GitBranch",
|
|
|
|
condition = require("galaxyline.condition").check_git_workspace,
|
|
|
|
condition = require("galaxyline.condition").check_git_workspace,
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
highlight = {colors.grey_fg2, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.right[4] = {
|
|
|
|
gls.right[4] = {
|
|
|
|
viMode_icon = {
|
|
|
|
viMode_icon = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
return " "
|
|
|
|
return " "
|
|
|
@ -154,9 +161,9 @@ M.config = function()
|
|
|
|
separator = " ",
|
|
|
|
separator = " ",
|
|
|
|
separator_highlight = {colors.red, colors.statusline_bg}
|
|
|
|
separator_highlight = {colors.red, colors.statusline_bg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.right[5] = {
|
|
|
|
gls.right[5] = {
|
|
|
|
ViMode = {
|
|
|
|
ViMode = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
local alias = {
|
|
|
|
local alias = {
|
|
|
@ -178,9 +185,9 @@ M.config = function()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
highlight = {colors.red, colors.lightbg}
|
|
|
|
highlight = {colors.red, colors.lightbg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.right[6] = {
|
|
|
|
gls.right[6] = {
|
|
|
|
some_icon = {
|
|
|
|
some_icon = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
return " "
|
|
|
|
return " "
|
|
|
@ -189,9 +196,9 @@ M.config = function()
|
|
|
|
separator_highlight = {colors.green, colors.lightbg},
|
|
|
|
separator_highlight = {colors.green, colors.lightbg},
|
|
|
|
highlight = {colors.lightbg, colors.green}
|
|
|
|
highlight = {colors.lightbg, colors.green}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gls.right[7] = {
|
|
|
|
gls.right[7] = {
|
|
|
|
line_percentage = {
|
|
|
|
line_percentage = {
|
|
|
|
provider = function()
|
|
|
|
provider = function()
|
|
|
|
local current_line = vim.fn.line(".")
|
|
|
|
local current_line = vim.fn.line(".")
|
|
|
@ -207,6 +214,4 @@ M.config = function()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
highlight = {colors.green, colors.lightbg}
|
|
|
|
highlight = {colors.green, colors.lightbg}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|
|
|
|
|
|
|
|