从 vim-fugitive 插件的 README 中:fugitive:
:Gblame 命令将以交互式垂直拆分方式显示 git blame 输出。 在一行上按回车键可编辑更改该行的提交,或按 o 键在拆分视图中打开它。
在我编辑了一个特定的提交后,是否可以返回到 blame 输出呢?
从 vim-fugitive 插件的 README 中:fugitive:
:Gblame 命令将以交互式垂直拆分方式显示 git blame 输出。 在一行上按回车键可编辑更改该行的提交,或按 o 键在拆分视图中打开它。
在我编辑了一个特定的提交后,是否可以返回到 blame 输出呢?
I think what you may be looking for is -
O
and o
instead of <CR>
if you know you will be going back to the commit.
Here are all the flags for the :Gblame
command:
有关
*fugitive-:Gblame* :Gblame [flags] Run git-blame on the file and open the results in a scroll bound vertical split. You can give any of ltfnsewMC as flags and they will be passed along to git-blame. The following maps, which work on the cursor line commit where sensible, are provided: g? show this help A resize to end of author column C resize to end of commit column D resize to end of date/time column q close blame and return to blamed window gq q, then |:Gedit| to return to work tree version <CR> q, then open commit o open commit in horizontal split O open commit in new tab - reblame at commit ~ reblame at [count]th first grandparent P reblame at [count]th parent (like HEAD^[count])
Fugitive
命令的更多信息,请查看此处。
-
会打开文件日志中的上一个提交。 - planetp另一个选项- 仅使用vim命令返回之前的缓冲区:
由于在vim-fugitive中按下'enter'会在旧缓冲区顶部打开一个新的vim缓冲区 - 您可以简单地使用vim命令返回:
:b 1
前往缓冲区1。
如果已经打开了太多的缓冲区,您可以列出它们:
:buffers
:G blame
命令会在垂直分割中产生两个缓冲区:一个是包含责备信息的缓冲区,与文件内容的缓冲区并排显示(并且与之绑定滚动),而:b 1
命令只会恢复其中一个缓冲区。 - undefined