2

While viewing diff of two files using vimdiff, when I do ]c to go to the next diff, the beginning of that next diff appears at the last line. Due to this, I have to scroll up few lines up to view the whole diff. Currently i do zt to take it to the top.

Is there any command / mapping that i can use to make the next diff appear at the top or at the centre?

Shod
  • 801
  • 3
  • 12
  • 33

1 Answers1

3
nnoremap ]c j]cztk

That seems to do the trick

It simply do the two commands you usually pair up. The k at the end goes up one line, because it seems that the zt goes up too far. And thus, the j is necessary so that vim actually goes to the next diff

Wazam
  • 310
  • 1
  • 3
  • 8