DEV Community

Cover image for How to Split Screens in vim
Liz Lam
Liz Lam

Posted on

6

How to Split Screens in vim

Have you ever found yourself going through a long file in vim and wishing you could split your screen? Perhaps you want to make some comparison with a chunk at the top of file with something in the middle. With a few keystrokes you can do exactly that.

Split Horizontally

Horizontal Screen Split

To split the screen horizontally:
a.) Hit CTRL + w
b.) and then s.

If you want to navigate between the screen:
a.) Hit CTRL + w
b.) and then w.

To exit out of one of the screen:
a.) Go into command mode (i.e. hit ESC)
b.) and quit as usual: :q.

Split Vertically

Vertical Screen Split

To split the screen vertically, much like splitting horizontally:
a.) Start by hitting CTRL + w
b.) but then hit v (instead of s).

Navigating between the split screens is the same (CTRL + w + w).

Though horizontal splitting works great. I find vertical splitting to be the most useful.

Combine Both

Vertical and Horizontal Screen Splitting

Why choose? It is possible to combine both horizontal and vertical screen splitting as well.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay