正如在How do I use vim as 'git log' editor?中所描述的,所有这些都不适用于git。我经常用
git show HEAD
ctrl+z
ps
PID TTY TIME CMD
7083 pts/8 00:00:06 bash
31758 pts/8 00:00:00 git
31759 pts/8 00:00:00 less
31762 pts/8 00:00:00 ps
更新我找到了解决方案:
git config --global pager.color false
git config --global pager.show 'vim -R -'
更好(2021-02-05)
git config --global core.pager 'vim -R -'
发布于 2015-01-20 15:34:29
您可以使用以下命令:
PAGER='vim -' git -c color.ui=false show
发布于 2015-01-20 06:52:19
这是一篇解决这个问题的推特帖子。
https://twitter.com/oliviergay/status/179692941063888896
将
git show
与vim
和语法突出显示一起使用:vimgitshow() { git show "$1" | vim - "+set filetype=${1##*.}"; }
发布于 2015-01-20 10:41:50
这对我起了作用:
git config --global pager.show "vim -c '%sm/\\e.\\{-}m//g' -c 'set ft=diff' +1 -"
在这里发现疯狂的vim args:https://stackoverflow.com/a/17015531/610634
https://stackoverflow.com/questions/28048270
复制