move statusline highlights to base46 repo

related to https://github.com/NvChad/base46/issues/77
This commit is contained in:
siduck 2022-05-20 23:13:18 +05:30
parent a8fd371b08
commit 8c16f487b5
1 changed files with 89 additions and 117 deletions

View File

@ -56,17 +56,11 @@ options.separator_style = options.icon_styles[nvchad.load_config().plugins.optio
options.main_icon = { options.main_icon = {
provider = options.separator_style.main_icon, provider = options.separator_style.main_icon,
hl = { hl = "FelineIcon",
fg = options.colors.statusline_bg,
bg = options.colors.nord_blue,
},
right_sep = { right_sep = {
str = options.separator_style.right, str = options.separator_style.right,
hl = { hl = "FelineIconSeparator",
fg = options.colors.nord_blue,
bg = options.colors.lightbg,
},
}, },
} }
@ -81,14 +75,12 @@ options.file_name = {
end end
return " " .. icon .. " " .. filename .. " " return " " .. icon .. " " .. filename .. " "
end, end,
hl = {
fg = options.colors.white, hl = "FelineFileName",
bg = options.colors.lightbg,
},
right_sep = { right_sep = {
str = options.separator_style.right, str = options.separator_style.right,
hl = { fg = options.colors.lightbg, bg = options.colors.lightbg2 }, hl = "FelineFileName_Separator",
}, },
} }
@ -98,57 +90,45 @@ options.dir_name = {
return "" .. dir_name .. " " return "" .. dir_name .. " "
end, end,
hl = { hl = "FelineDirName",
fg = options.colors.grey_fg2,
bg = options.colors.lightbg2,
},
right_sep = { right_sep = {
str = options.separator_style.right, str = options.separator_style.right,
hi = { hi = "FelineDirName_Separator",
fg = options.colors.lightbg2,
bg = options.colors.statusline_bg,
},
}, },
} }
-- Git
options.diff = { options.diff = {
add = { add = {
provider = "git_diff_added", provider = "git_diff_added",
hl = { hl = "Feline_diffIcons",
fg = options.colors.grey_fg2,
bg = options.colors.statusline_bg,
},
icon = "", icon = "",
}, },
change = { change = {
provider = "git_diff_changed", provider = "git_diff_changed",
hl = { hl = "Feline_diffIcons",
fg = options.colors.grey_fg2,
bg = options.colors.statusline_bg,
},
icon = "", icon = "",
}, },
remove = { remove = {
provider = "git_diff_removed", provider = "git_diff_removed",
hl = { hl = "Feline_diffIcons",
fg = options.colors.grey_fg2,
bg = options.colors.statusline_bg,
},
icon = "", icon = "",
}, },
} }
options.git_branch = { options.git_branch = {
provider = "git_branch", provider = "git_branch",
hl = { hl = "Feline_diffIcons",
fg = options.colors.grey_fg2,
bg = options.colors.statusline_bg,
},
icon = "", icon = "",
} }
-- lsp
options.diagnostic = { options.diagnostic = {
error = { error = {
provider = "diagnostic_errors", provider = "diagnostic_errors",
@ -156,7 +136,7 @@ options.diagnostic = {
return options.lsp.diagnostics_exist(options.lsp_severity.ERROR) return options.lsp.diagnostics_exist(options.lsp_severity.ERROR)
end, end,
hl = { fg = options.colors.red }, hl = "Feline_lspError",
icon = "", icon = "",
}, },
@ -165,7 +145,8 @@ options.diagnostic = {
enabled = function() enabled = function()
return options.lsp.diagnostics_exist(options.lsp_severity.WARN) return options.lsp.diagnostics_exist(options.lsp_severity.WARN)
end, end,
hl = { fg = options.colors.yellow },
hl = "Feline_lspWarning",
icon = "", icon = "",
}, },
@ -174,7 +155,7 @@ options.diagnostic = {
enabled = function() enabled = function()
return options.lsp.diagnostics_exist(options.lsp_severity.HINT) return options.lsp.diagnostics_exist(options.lsp_severity.HINT)
end, end,
hl = { fg = options.colors.grey_fg2 }, hl = "Feline_LspHints",
icon = "", icon = "",
}, },
@ -183,11 +164,25 @@ options.diagnostic = {
enabled = function() enabled = function()
return options.lsp.diagnostics_exist(options.lsp_severity.INFO) return options.lsp.diagnostics_exist(options.lsp_severity.INFO)
end, end,
hl = { fg = options.colors.green }, hl = "Feline_LspInfo",
icon = "", icon = "",
}, },
} }
options.lsp_icon = {
provider = function()
if next(vim.lsp.buf_get_clients()) ~= nil then
local lsp_name = vim.lsp.get_active_clients()[1].name
return "  LSP ~ " .. lsp_name .. " "
else
return ""
end
end,
hl = "Feline_LspIcon",
}
options.lsp_progress = { options.lsp_progress = {
provider = function() provider = function()
local Lsp = vim.lsp.util.get_progress_messages()[1] local Lsp = vim.lsp.util.get_progress_messages()[1]
@ -196,11 +191,7 @@ options.lsp_progress = {
local msg = Lsp.message or "" local msg = Lsp.message or ""
local percentage = Lsp.percentage or 0 local percentage = Lsp.percentage or 0
local title = Lsp.title or "" local title = Lsp.title or ""
local spinners = { local spinners = { "", "", "", "", "", "", "", "", "", "" }
"",
"",
"",
}
local success_icon = { local success_icon = {
"", "",
@ -220,56 +211,43 @@ options.lsp_progress = {
return "" return ""
end, end,
hl = { fg = options.colors.green }, hl = "Feline_LspProgress",
} }
options.lsp_icon = { -- MODES
provider = function()
if next(vim.lsp.buf_get_clients()) ~= nil then
return "  LSP"
else
return ""
end
end,
hl = { fg = options.colors.grey_fg2, bg = options.colors.statusline_bg },
}
options.mode_colors = { options.mode_colors = {
["n"] = { "NORMAL", options.colors.red }, ["n"] = { "NORMAL", "Feline_NormalMode" },
["no"] = { "N-PENDING", options.colors.red }, ["no"] = { "N-PENDING", "Feline_NormalMode" },
["i"] = { "INSERT", options.colors.dark_purple }, ["i"] = { "INSERT", "Feline_InsertMode" },
["ic"] = { "INSERT", options.colors.dark_purple }, ["ic"] = { "INSERT", "Feline_InsertMode" },
["t"] = { "TERMINAL", options.colors.green }, ["t"] = { "TERMINAL", "Feline_TerminalMode" },
["v"] = { "VISUAL", options.colors.cyan }, ["v"] = { "VISUAL", "Feline_VisualMode" },
["V"] = { "V-LINE", options.colors.cyan }, ["V"] = { "V-LINE", "Feline_VisualMode" },
[""] = { "V-BLOCK", options.colors.cyan }, [""] = { "V-BLOCK", "Feline_VisualMode" },
["R"] = { "REPLACE", options.colors.orange }, ["R"] = { "REPLACE", "Feline_ReplaceMode" },
["Rv"] = { "V-REPLACE", options.colors.orange }, ["Rv"] = { "V-REPLACE", "Feline_ReplaceMode" },
["s"] = { "SELECT", options.colors.nord_blue }, ["s"] = { "SELECT", "Feline_SelectMode" },
["S"] = { "S-LINE", options.colors.nord_blue }, ["S"] = { "S-LINE", "Feline_SelectMode" },
[""] = { "S-BLOCK", options.colors.nord_blue }, [""] = { "S-BLOCK", "Feline_SelectMode" },
["c"] = { "COMMAND", options.colors.pink }, ["c"] = { "COMMAND", "Feline_CommandMode" },
["cv"] = { "COMMAND", options.colors.pink }, ["cv"] = { "COMMAND", "Feline_CommandMode" },
["ce"] = { "COMMAND", options.colors.pink }, ["ce"] = { "COMMAND", "Feline_CommandMode" },
["r"] = { "PROMPT", options.colors.teal }, ["r"] = { "PROMPT", "Feline_ConfirmMode" },
["rm"] = { "MORE", options.colors.teal }, ["rm"] = { "MORE", "Feline_ConfirmMode" },
["r?"] = { "CONFIRM", options.colors.teal }, ["r?"] = { "CONFIRM", "Feline_ConfirmMode" },
["!"] = { "SHELL", options.colors.green }, ["!"] = { "SHELL", "Feline_TerminalMode" },
} }
options.chad_mode_hl = function() local fn = vim.fn
return {
fg = options.mode_colors[vim.fn.mode()][2], local function get_color(group, attr)
bg = options.colors.one_bg, return fn.synIDattr(fn.synIDtrans(fn.hlID(group)), attr)
}
end end
options.empty_space = { options.empty_space = {
provider = " " .. options.separator_style.left, provider = " " .. options.separator_style.left,
hl = { hl = "Feline_EmptySpace",
fg = options.colors.one_bg2,
bg = options.colors.statusline_bg,
},
} }
-- this matches the vi mode color -- this matches the vi mode color
@ -277,51 +255,43 @@ options.empty_spaceColored = {
provider = options.separator_style.left, provider = options.separator_style.left,
hl = function() hl = function()
return { return {
fg = options.mode_colors[vim.fn.mode()][2], fg = get_color(options.mode_colors[vim.fn.mode()][2], "fg#"),
bg = options.colors.one_bg2, bg = get_color("Feline_EmptySpace", "fg#"),
} }
end, end,
} }
options.mode_icon = { options.mode_icon = {
provider = options.separator_style.vi_mode_icon, provider = options.separator_style.vi_mode_icon,
hl = function()
return { hl = {
fg = options.colors.statusline_bg, fg = get_color("Normal", "bg#"),
bg = options.mode_colors[vim.fn.mode()][2], bg = get_color(options.mode_colors[vim.fn.mode()][2], "fg#"),
} },
end,
} }
options.empty_space2 = { options.empty_space2 = {
provider = function() provider = function()
return " " .. options.mode_colors[vim.fn.mode()][1] .. " " return " " .. options.mode_colors[vim.fn.mode()][1] .. " "
end, end,
hl = options.chad_mode_hl, hl = function()
return options.mode_colors[vim.fn.mode()][2]
end,
} }
options.separator_right = { options.separator_right = {
provider = options.separator_style.left, provider = options.separator_style.left,
hl = { hl = "Feline_EmptySpace",
fg = options.colors.grey,
bg = options.colors.one_bg,
},
} }
options.separator_right2 = { options.separator_right2 = {
provider = options.separator_style.left, provider = options.separator_style.left,
hl = { hl = "Feline_PositionSeparator",
fg = options.colors.green,
bg = options.colors.grey,
},
} }
options.position_icon = { options.position_icon = {
provider = options.separator_style.position_icon, provider = options.separator_style.position_icon,
hl = { hl = "Feline_PositionIcon",
fg = options.colors.black,
bg = options.colors.green,
},
} }
options.current_line = { options.current_line = {
@ -338,10 +308,7 @@ options.current_line = {
return " " .. result .. "%% " return " " .. result .. "%% "
end, end,
hl = { hl = "Feline_CurrentLine",
fg = options.colors.green,
bg = options.colors.one_bg,
},
} }
options = nvchad.load_override(options, "feline-nvim/feline.nvim") options = nvchad.load_override(options, "feline-nvim/feline.nvim")
@ -361,9 +328,9 @@ options.right = {}
add_table(options.left, options.main_icon) add_table(options.left, options.main_icon)
add_table(options.left, options.file_name) add_table(options.left, options.file_name)
add_table(options.left, options.dir_name) add_table(options.left, options.dir_name)
add_table(options.left, options.diff.add)
add_table(options.left, options.diff.change) -- lsp
add_table(options.left, options.diff.remove) add_table(options.left, options.lsp_icon)
add_table(options.left, options.diagnostic.error) add_table(options.left, options.diagnostic.error)
add_table(options.left, options.diagnostic.warning) add_table(options.left, options.diagnostic.warning)
add_table(options.left, options.diagnostic.hint) add_table(options.left, options.diagnostic.hint)
@ -372,8 +339,13 @@ add_table(options.left, options.diagnostic.info)
add_table(options.middle, options.lsp_progress) add_table(options.middle, options.lsp_progress)
-- right -- right
add_table(options.right, options.lsp_icon)
-- git diffs
add_table(options.right, options.diff.add)
add_table(options.right, options.diff.change)
add_table(options.right, options.diff.remove)
add_table(options.right, options.git_branch) add_table(options.right, options.git_branch)
add_table(options.right, options.empty_space) add_table(options.right, options.empty_space)
add_table(options.right, options.empty_spaceColored) add_table(options.right, options.empty_spaceColored)
add_table(options.right, options.mode_icon) add_table(options.right, options.mode_icon)
@ -391,8 +363,8 @@ options.components.active[2] = options.middle
options.components.active[3] = options.right options.components.active[3] = options.right
options.theme = { options.theme = {
bg = options.colors.statusline_bg, fg = get_color("Feline", "fg#"),
fg = options.colors.fg, bg = get_color("Feline", "bg#"),
} }
feline.setup { feline.setup {