lambdalisue / vim-gita

[Obsolete] An awesome git handling plugin for Vim
Other
226 stars 8 forks source link

RFC: Display current mode which git in #50

Closed lambdalisue closed 9 years ago

lambdalisue commented 9 years ago

git status or git commit show current mode which git in, like 'merge', 'rebase', or 'cherry-pick'.

Currently gita does not have any function to get the current mode, I have no idea how to get the current mode but it is quite helpful if gita can show the mode.

lambdalisue commented 9 years ago

Let me know if you know how to figure out which mode git currently in.

rafi commented 9 years ago

You can check the mode mostly by identifying filename within the .git dir: git/blob/master/contrib/completion/git-prompt.sh#L395-L456

lambdalisue commented 9 years ago

Cool, thanks a lot :-)

lambdalisue commented 9 years ago

memo This feature should be provided in vital-vcs-git

lambdalisue commented 9 years ago

Thanks to @rafi. vim-gita now show the branch status in gita#statusline#preset('branch'), gita:status and gita:commit window.

selection_039

rafi commented 9 years ago

Woohoo, thanks! Could you share this awesome tabline of yours from the screenshot? :)

lambdalisue commented 9 years ago

While I'm using lightline.vim, my &tabline show %!lightline#tabline() so doesn't tell you anything... (See https://github.com/lambdalisue/vim-gita#statusline for lightline config).

But you can use gita#statusline#preset('branch') or whatever to show the information without using lightline.vim. For example the following show branch (and mode) in tabline (without tabname or tabnumber or whatever so it is useless lol).

set tabline=%!gita#statusline#preset('branch')

Probably you need to define your own tabline function or use lightline.vim or whatever