【问题标题】:How to go back to the results of :Gblame after selecting a particular commit?选择特定提交后如何返回 :Gblame 的结果?
【发布时间】:2014-09-12 03:54:03
【问题描述】:

来自fugitive vim 插件的自述文件:

:Gblame 使用 git blame 输出进行交互式垂直拆分。 在一行上按 enter 以编辑该行更改的提交,或者 o 以拆分方式打开它。

在特定提交上按回车后,是否可以返回责备输出?

【问题讨论】:

  • 你知不知道你又要重蹈覆辙?如果是这样,您应该使用 o 而不是 <cr> 来查看提交
  • @Peter:好的。您可以将此添加为答案吗?

标签: git vim vim-plugin git-blame


【解决方案1】:

我想你可能要找的是-

编辑:你真正想要的是Oo,而不是<CR>,如果你知道你会回到提交。

以下是:Gblame 命令的所有标志:

                                           *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 命令的更多信息,请查看here

【讨论】:

  • 不。对我来说,- 从文件的日志中打开 previos 提交
  • 哦,其他标志有帮助吗?因为我认为这就是:Gblame 命令的全部内容。
  • 我很高兴能够提供帮助,尽管我最初的建议是不正确的。我会为未来有相同问题的人编辑答案
【解决方案2】:

另一个选项 - 仅使用 vim 命令转到上一个缓冲区:

由于在 vim-fugitive 中按 'enter' 会在旧缓冲区之上打开一个新的 vim 缓冲区 - 您可以简单地使用 vim 命令返回:

:b 1 

(转到 1 号缓冲区)。

如果已经有太多打开的缓冲区,你可以列出它们:

:buffers

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-11
    • 2020-02-11
    • 1970-01-01
    相关资源
    最近更新 更多