← All lessons

12. Windows

Step 7 of 9

Resizing windows

You can resize windows so that they fit your preferences.

The first thing to know is that the <C-w> bindings for creating windows accept counts, which you can use to set the size of the new window right from the get. For example <C-w>80s (or 80<C-w>s if you prefer — there’s no difference) will open up a new horizontal split that’s 80 characters high. You can do the same with <C-w>v — so <C-w>80v or 80<C-w>v — to open up a new vertical split that’s 80 characters wide.

If you want to resize windows after creating them, no problem — here are the bindings to know:

I personally find the bindings above a little bit fiddly though. Most of the time I find myself reaching for these ones instead:

Finally — and this is a really useful one, so write this down! — <C-w>= will automatically resize all of your windows to sensible defaults in case you want to reset everything.

There are a lot of bindings for resizing windows! It kind of makes sense — there are lots of ways that windows can be resized.

In your local instance of Vim, you’ll be able to enable mouse support with set mouse+=a, which makes window resizing intuitive. Unfortunately you can’t do this in the embedded editor right now because it doesn’t support it yet — sorry about that!

Let’s try resizing some windows in the editor. Try:

Loading editor…