junegunn/gv.vim

Colored tree structure

languitar opened this issue · 2 comments

On the command line I use the following command to get a similar view of the history as provided by this plugin:

git log --pretty=format:'%C(auto)%h %cd (%G?) %C(green)[%an]%C(auto)%d%Creset %s' --date=short --graph --full-history --all

This results in a colored representation of the tree structure:
image

It would be nice if this was also available in GV.

mhinz commented

When "using the shell", you have your terminal emulator reading and displaying ANSI escape sequences that are used for coloring.

You don't have something like that in Vim. You can only define regular expressions for certain regions and color them according to a highlight group.

gv uses --color=never and colors the raw log output itself.

The closest you can get to what you're asking for is installing powerman/vim-plugin-AnsiEsc first, and then:

:enew
:r! git log -30 --oneline --graph --color=always
:AnsiEsc

For a long log that can take a while (hence the -30 limit) and :AnsiEsc is not perfect. It doesn't understand all the sequences from my colored log.

Putting it in a nutshell, such a change is complex and will most probably not happen in gv. :)

sad to hear as this would be very handy