I had write a bash script to switch from using vim as 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 to use diff-so-fancy.
If you just want to use vim as your git log editor git config --global pager.show "vim -c '%sm/\\e.\\{-}m//g' -c
will satisfy you.
$ git log
is not something you edit so why exactly do you want to use an editor to view it? – Mallet/
,?
,n
andN
, it supports regex search.$ man less
is a very interesting read. – Mallet