feat(nvim): read diff status from gitsigns
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
57a5042860
commit
2340f9703a
|
@ -10,6 +10,14 @@ local mode_map = {
|
|||
["V-LINE"] = "V-LINE",
|
||||
}
|
||||
|
||||
local function format_diff_element(val, sym)
|
||||
if val == nil or val < 1 then
|
||||
return ""
|
||||
end
|
||||
|
||||
return sym .. val
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
|
@ -31,7 +39,28 @@ require("lualine").setup({
|
|||
"branch",
|
||||
padding = { left = 0 },
|
||||
},
|
||||
"diff",
|
||||
-- render coloured output from gitsigns, this doesn't seem to work with b:gitsigns_status:
|
||||
{
|
||||
function()
|
||||
return format_diff_element(vim.b.gitsigns_status_dict.added, "+")
|
||||
end,
|
||||
color = { fg = "#a3be8c" },
|
||||
padding = 0,
|
||||
},
|
||||
{
|
||||
function()
|
||||
return format_diff_element(vim.b.gitsigns_status_dict.changed, "~")
|
||||
end,
|
||||
color = { fg = "#ebcb8b" },
|
||||
padding = 0,
|
||||
},
|
||||
{
|
||||
function()
|
||||
return format_diff_element(vim.b.gitsigns_status_dict.removed, "-")
|
||||
end,
|
||||
color = { fg = "#bf616a" },
|
||||
padding = 0,
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_lsp" },
|
||||
|
|
Loading…
Reference in New Issue