tamton-aquib / staline.nvim

A modern lightweight statusline and bufferline plugin for neovim in lua.
MIT License
380 stars 17 forks source link

Add Git Diff in StaLine #27

Closed sahashirshendu closed 2 years ago

sahashirshendu commented 2 years ago

Is it possible to add git diff in the statusline like lualine shows?

bryant-the-coder commented 2 years ago

ye. great idea =)

tamton-aquib commented 2 years ago

Heyyo @sahashirshendu ,

I have the gitsigns plugin installed and it exposes buffer variables like gitsigns_status and gitsigns_status_dict. In my case, i use this component:

function()
    return vim.b.gitsigns_status or ''
end

This will be formatted the way that we provide inside gitsigns setup() function.

We could also use the b:gitsigns_status_dict for more finer control.

sahashirshendu commented 2 years ago

Thanks. It is what I was looking for.