git - 如何使用 vim 作为 'git show' 编辑器?

标签 git vim

全部如How do I use vim as 'git log' editor?所述不适用于 git show 。 我经常用

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 -'

https://stackoverflow.com/a/16666055/778517

最佳答案

您可以使用以下命令:

PAGER='vim -' git -c color.ui=false show

关于git - 如何使用 vim 作为 'git show' 编辑器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28048270/

相关文章:

git - 如何删除裸 `git` 存储库中的唯一分支?

git - 如何在不从 repo 中删除文件的情况下停止跟踪文件

git - 一种使 --no-ff 成为 git merge 的默认行为的方法

git - GnuTLS接收错误(-110): The TLS connection was non-properly terminated

vim - 如何在 mac 上正确安装 YouCompleteMe?

vim - 为什么 VimClojure 没有将文件类型设置为 "clojure"

git bitbucket私有(private)子模块ssh别名问题

git - 我是否应该在 Git Flow 中拥有长期的特性分支?

Vim - 删除直到找到一个模式,但方向相反

vim - 向左或向右移动当前单词 ("leapfrogging"其他单词)