How do I use vim as 'git show' editor?

前端 未结 5 1632
深忆病人
深忆病人 2021-02-08 12:50

all as described in How do I use vim as 'git log' editor? doesn\'t work for git show . I use often

git show HEAD

ctrl+z 

ps 

  PID TTY          TIME CM         


        
5条回答
  •  遥遥无期
    2021-02-08 13:47

    This worked for me:

    git config --global pager.show "vim -c '%sm/\\e.\\{-}m//g' -c 'set ft=diff' +1 -"
    

    Crazy vim args found here: https://stackoverflow.com/a/17015531/610634

提交回复
热议问题