Moving Splits

3.3
(438)

You may be familiar with Vim’s split capability which allows splitting your screen vertically, horizontally, or both. (If not, see :help split for an overview.) Once you have split your screen, how can you rearrange your splits? It’s easy with ctrl-w:

  • ctrl-w J moves the active to the bottom
  • ctrl-w H moves the active split to the left
  • ctrl-w K moves the active split to the top
  • ctrl-w L moves the active split to right
  • ctrl-w r rotates splits to the right/down
  • ctrl-w R rotates splits to the left/up

Here’s a short screencast showing a screen split into 3 horizontal splits:

In the screencast, we have focus in the top split. First, use ctrl-w r to rotate the splits down/right which moves our in-focus split to the middle. We repeat ctrl-w r to rotate again and our split is on the bottom. Next, we use the opposite movement: ctrl-w R to rotate up/left, which we again repeat to reposition our split at the top. Last we use ctrl-w J to move our split all the way to the bottom, which accomplishes the same thing as ctrl-w r ctrl-w r, but in one less keystroke.

This is really just scratching the surface of split movements and actions, but this one trick can really help reorganize your screen for maximum efficiency. Stay tuned for further tips and tricks on using splits!

How useful was this post?

Average rating 3.3 / 5. Vote count: 438

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Written by

Andy Libby

22 Posts

Rides bikes. Codes ruby. Studies Vim.
View all posts

Leave a reply

Your email address will not be published. Required fields are marked *