I wrote a bash script to switch from using vim as an editor to diff-so-fancy.
VT() { gitlogflag=true if [ -e "$HOME/.myscriptvar" ] ; then gitlogflag=$(cat "$HOME/.myscriptvar") fi if [ "$gitlogflag" = true ]; then git config --global pager.show "vim -c '%sm/\\e.\\{-}m//g' -c 'setlocal buftype=nofile' -c 'set ft=diff' +3 -"; gitlogflag=false else git config --global pager.show "diff-so-fancy | less --tabs=1,5 -RFX"; gitlogflag=true fi echo "$gitlogflag" > $HOME/.myscriptvar }
I recommend you use diff-so-fancy .
If you just want to use vim, since your git log editor git git config --global pager.show "vim -c '%sm/\\e.\\{-}m//g' -c satisfy you.
Yonghao hu
source share