Reuse gitsigns information
This commit is contained in:
parent
cf129ad7f6
commit
bd146ae1d8
1 changed files with 17 additions and 1 deletions
|
|
@ -13,10 +13,26 @@ local function active_lsps()
|
|||
return ('LSP: %s (%d)'):format(preview_client.name, #attached_clients)
|
||||
end
|
||||
|
||||
local function diff_source()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
lualine.setup {
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics', active_lsps },
|
||||
lualine_b = {
|
||||
{'b:gitsigns_head', icon = ''},
|
||||
{'diff', source = diff_source},
|
||||
'diagnostics',
|
||||
active_lsps
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue