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?
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