【问题标题】:How do I jump to the next/prev diff in GIT difftool?如何跳转到 GIT difftool 中的下一个/上一个差异?
【发布时间】:2015-01-24 22:00:33
【问题描述】:

我正在使用 git difftool 比较 VIM 中的 2 个大文件。我只想导航到不同的行。

如何使用 GIT difftool 在不同的行之间快速导航?

我正在寻找类似 winmerge 快捷键的东西:
Alt+down - 下一个更改
Alt+Up - 上一个更改

【问题讨论】:

  • 抱歉,我对 VIM 很陌生

标签: git vim difftool


【解决方案1】:

vim 有一个广泛而非常好的帮助文件。尝试熟悉它会帮自己一个忙。

来自:h diff

3. Jumping to diffs                 *jumpto-diffs*

Two commands can be used to jump to diffs:
                                *[c*
    [c      Jump backwards to the previous start of a change.
            When a count is used, do it that many times.
                                *]c*
    ]c      Jump forwards to the next start of a change.
            When a count is used, do it that many times.

【讨论】:

  • 我决定使用 F5 和 F6,将这些行添加到 .vimrc : noremap <F5> [cnoremap <F6> ]c
  • 在我的 vimrc 中,这些已经被用来最大化/标准化我的窗口。 ][ 很难接触到,但它在很多地方都使用过 (tmux, vim, ctags),所以我决定加入他们,试图打败他们。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-03-02
  • 2021-08-11
  • 2014-04-19
  • 2014-03-10
  • 2019-10-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多