Navigating splits

3.7
(93)

We’ve written a lot about splits, which divide your screen into either horizontal (:split) or vertical (:vsplit) segments. If you’re working with only two, or maybe three, open splits at once, the easiest way to navigate is with <ctrl-w> w which moves to the window below or right of the current one (or back to the top left if there nothing below or to the right).

  • <ctrl-w> w – Move to the window right or below or back to the top left

With two splits open, this will simply bounce you back and forth between them. With more open, it gets complicated. You can just remember that <ctrl-w> w will move in a z pattern across your screen. First to window A, then B, then C, then D, then back to A:

There’s also another way, which might be easier to remember and definitely works better when you have many splits open. Use <ctrl-w> plus a directional: h, j, k, or l. These shortcuts will move you left, down, up, or right across the splits in your current window.

  • <ctrl-w> h – Move to the split to the left
  • <ctrl-w> j – Move to the split below
  • <ctrl-w> k – Move to the split above
  • <ctrl-w> l – Move to the split to the right

How useful was this tip?

Average rating 3.7 / 5. Vote count: 93

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

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

Colin Bartlett

105 Posts

Vim enthusiast and software developer for more than 20 years.
View all posts