Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I toggle between a Vertical and a Horizontal split in vimdiff?

I already know how to use the diffopt variable to start diff mode with horizontal/vertical splits but not how to toggle between the two when I already have two files open for comparison.

I tried the accepted answer found in this older post, but to no avail. The Ctrl+W commands didn't work for me. Perhaps because I'm running gVim in Windows-friendly mode?

like image 408
drapkin11 Avatar asked Oct 03 '22 13:10

drapkin11


1 Answers

The following command will change a vertical split into a horizontal split:

ctrl+w then J

To change back to a vertical split use either:

ctrl+w H or ctrl+w L

For more information about moving windows:

:h window-moving
:h ctrl-w_J
:h ctrl-w_K
:h ctrl-w_H
:h ctrl-w_L
like image 197
Peter Rincker Avatar answered Oct 05 '22 06:10

Peter Rincker