Moving windows

Windows can also be moved, swapped, and resized. Since there's no drag-and-drop functionality in Vim, there are some commands you will have to remember.

You don't have to remember all of these commands, as long as you know what window operations are supported. :help window-moving and :help window-resize will take you to the corresponding entries in the Vim manual when you inevitably forget the shortcuts.

As with the rest of the window commands, these are prefixed by Ctrl + w.

Ctrl + w followed, by an uppercase movement key (H, J, K, or L) will move the current window to the corresponding position:

  • Ctrl + w, H moves the current window to the leftmost part of the screen
  • Ctrl + w, J moves the current window to the bottom of the ...

Get Mastering Vim now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.