Closed meseck closed 1 year ago
Gitsigns exposes a vim.b.gitsigns_status_dict
, and emits an autocommand when it is updated. That'd probably be the easiest way.
I thought of that too, that is exactly what I do in my lualine
configuration. But that would make gitsigns
a dependency.
Maybe this lualine
approach for custom sections (indicators in our case) would be a better approach? That way everyone can pass what they want after the filename.
The git
indicators could then be an example in the documentation.
What do you think? :)
We have #426 open for a custom sections API (still a WIP, we want to stabilize these latest few changes first).
We could always make a default gitsigns section (just to minimize the code in the repo) and let people write a custom one later, if they wish.
People can always skip the gitsigns dep if they use a custom section and/or disable the builtin git section, we do something similar for nvim-web-devicons
.
If you want to write a PR, the files you'll want to take a look at are:
config
, to make the added/changed/removed icons configurablelayout
, to inform the rest of the code that the git info will be presentrender
, to draw the iconshighlight
, to add new groups that users can customizeSomething similar in structure to icons.diagnostics
would probably work, i.e.
icons = {
git = {
enabled = true,
added = '<added icon>',
-- … changed/deleted,etc
},
current = {git = {enabled = false}},
}
Closed by #463
It would be nice to have some optional git indicators, similar to what the plugin already does for the lsp diagnostics.
Please let me know if this could be part of the plugin. I would like to give it a try and open a PR for this feature. Thanks!