16

I am using git difftool to compare 2 large files in VIM. I want to navigate only to the lines that differ.

How do I navigate quickly between lines that differ using GIT difftool ?

I am looking for something like winmerge shortcut keys :
Alt+down - Next Change
Alt+Up - Prev Change

FacePalm
  • 10,992
  • 5
  • 48
  • 50

1 Answers1

31

vim Has an extensive and pretty good helpfile. You would do yourself a favour trying to familiarize yourself with it.

from :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.
Lieven Keersmaekers
  • 57,207
  • 13
  • 112
  • 146
  • 1
    I decided to use F5 and F6, by adding these lines to `.vimrc` : `noremap [c` and `noremap ]c` – Flimm Mar 05 '20 at 09:56
  • In my vimrc, those are already taken to maximimize/normalize my window. The `]` and `[` are hard to reach but it's used in so many places *(tmux, vim, ctags)* that I decided to join them io trying to beat them. – Lieven Keersmaekers Mar 05 '20 at 12:31
  • @Flimm could you comment how to set it to be on F5 & F6 ? – PowerPlay Aug 11 '22 at 00:36