cd /news/developer-tools/resize-vim-windows · home topics developer-tools article
[ARTICLE · art-12990] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Resize VIM windows

This article explains how to efficiently resize split windows in Vim version 7.0. It covers commands like `:resize` and `:vertical resize` for adjusting height and width by specific values or increments, as well as keyboard shortcuts such as `Ctrl-w +` and `Ctrl-w -` for row-by-row adjustments. The tip also mentions using `Ctrl-w =` to equalize window sizes, `Ctrl-w _` and `Ctrl-w |` for maximizing dimensions, and mouse-based resizing in Gvim.

read2 min views25 publishedNov 20, 2018

Resize splits more quickly EDIT SHARE Tip 1215 Printable Monobook Previous Next created April 26, 2006 · complexity basic · author Robert & Bill · version 7.0 This tip is about how to resize Windows efficiently. You can use the :resize command or its shortcut :res to change the height of the window. To change the height to 60 rows, use: :resize 60 You can also change the height in increments. To change the height by increments of 5, use: :res +5 :res -5 You can use :vertical resize to change the width of the current window. To change the width to 80 columns, use: :vertical resize 80 You can also change the width in increments. To change the width by increments of 5, use:

:vertical resize +5 :vertical resize -5
For a split window: You can use Ctrl-w + and Ctrl-w - to resize the height of the current window by a single row. For a vsplit window: You can use Ctrl-w > and Ctrl-w < to resize the width of the current window by a single column. Additionally, these key combinations accept a count prefix so that you can change the window size in larger steps. [e.g. Ctrl-w 10 + increases the window size by 10 lines]

To resize all windows to equal dimensions based on their splits, you can use Ctrl-w =. To increase a window to its maximum height, use Ctrl-w _. To increase a window to its maximum width, use Ctrl-w |. set wfh set wfw (set WinFixHeight, set WinFixWidth) You can set them on the window that you want to stay the same, but unfortunately only Ctrl-W = listens to that, not Ctrl-W _ To resize in different steps, you can create maps that will adjust the window size differently. For example to increase the window size by a factor of 1.5 and decrease the window size by 0.67, you can map this: nnoremap + :exe "resize " . (winheight(0) * 3/2) nnoremap - :exe "resize " . (winheight(0) * 2/3) In Gvim and vim in terminals with mouse support, it is also possible to use the mouse to resize a window. Simply grab the statusline at the window border and drag it into the desired direction.

── more in #developer-tools 4 stories · sorted by recency
── more on @vim 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/resize-vim-windows] indexed:0 read:2min 2018-11-20 ·