Eddie Parker
Eddie Parker

Reputation: 4888

vimdiff: start in second split?

When using vimdiff, I'd like to start in the second pane (my changes), instead of the first.

I've tried adding this to my .vimrc, but it doesn't seem to work. Is there a different event I should be hooking?

if &diff
  autocmd BufWinEnter * winc l
endif

Upvotes: 1

Views: 81

Answers (1)

sudo bangbang
sudo bangbang

Reputation: 28229

The following worked for me

if &diff
  autocmd VimEnter * normal ^W^L
endif

Note here that ^W and ^L are single characters. You can enter them using ctrlvctrlwctrlvctrll

Upvotes: 2

Related Questions