{"slug": "resize-vim-windows", "title": "Resize VIM windows", "summary": "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.", "body_md": "Resize splits more quickly EDIT\nSHARE Tip 1215 Printable Monobook Previous Next created April 26, 2006 · complexity basic · author Robert & Bill · version 7.0\nThis tip is about how to resize Windows efficiently.\nYou can use the :resize command or its shortcut :res to change the height of the window. To change the height to 60 rows, use:\n:resize 60 You can also change the height in increments. To change the height by increments of 5, use:\n:res +5 :res -5\nYou can use :vertical resize to change the width of the current window. To change the width to 80 columns, use:\n:vertical resize 80 You can also change the width in increments. To change the width by increments of 5, use:\n:vertical resize +5 :vertical resize -5\nFor 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]\nTo resize all windows to equal dimensions based on their splits, you can use Ctrl-w =.\nTo increase a window to its maximum height, use Ctrl-w _.\nTo increase a window to its maximum width, use Ctrl-w |.\nset wfh\nset wfw\n(set WinFixHeight, set WinFixWidth)\nYou can set them on the window that you want to stay the same, but unfortunately only Ctrl-W = listens to that, not Ctrl-W _\nTo 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:\nnnoremap + :exe \"resize \" . (winheight(0) * 3/2) nnoremap - :exe \"resize \" . (winheight(0) * 2/3)\nIn 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.", "url": "https://wpnews.pro/news/resize-vim-windows", "canonical_source": "https://gist.github.com/antmd/bfc2c7e0711a47ed72373c3a3e027bae", "published_at": "2018-11-20 10:14:21+00:00", "updated_at": "2026-05-24 03:05:33.954786+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["VIM", "Robert", "Bill"], "alternates": {"html": "https://wpnews.pro/news/resize-vim-windows", "markdown": "https://wpnews.pro/news/resize-vim-windows.md", "text": "https://wpnews.pro/news/resize-vim-windows.txt", "jsonld": "https://wpnews.pro/news/resize-vim-windows.jsonld"}}