Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created July 30, 2018 00:39
Show Gist options
  • Select an option

  • Save goddoe/cda1ef14b80b18c1676afa4b8a962a4a to your computer and use it in GitHub Desktop.

Select an option

Save goddoe/cda1ef14b80b18c1676afa4b8a962a4a to your computer and use it in GitHub Desktop.
swap between split windows in vim

Reference : https://stackoverflow.com/questions/2228353/how-to-swap-files-between-windows-in-vim author : DrAl https://stackoverflow.com/users/72791/dral

There are a few useful commands built in which give you a certain amount of control, but it's not comprehensive. The main ones are:

Ctrl-W, r (i.e. hold CTRL, press W, release CTRL, press r) - which rotates the windows (The first window becomes the second one, the second one becomes the third one, etc.)
Ctrl-W, x - swap the current window with the next one
Ctrl-W, Shift-H - move this window to the far left
Ctrl-W, Shift-K - move this window to the top
(and similarly for Ctrl-W, Shift-J and Ctrl-W, Shift-L). See:

:help window-moving
for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment