sponsor Vim development Vim logo Vim Book Ad

vim-maximizer : Maximizes and restores the current window in Vim.

 script karma  Rating 35/15, Downloaded by 949  Comments, bugs, improvements  Vim wiki

created by
Szymon Wrozynski
script type

Maximizer lets you maximize split windows and restore them automatically. It is very useful if you like to have many split windows per tab. And also, if the text you are working with does not ...subscribe to the ridiculous Church of 80-character Lines.... It means, while working with Ruby on Rails code. ;) Or just with lengthy HTML files.


Maximizer has only one command:


It is meant to be mapped in many ways by the user himself. See Configuration to get some examples.

Upon the first invocation of the command, Vim-Maximizer saves dimensions and positions of all windows in the current tab, and then it performs maximization of the active window. The second time the command is invoked, Maximizer restores all windows to the previously saved positions and the cycle repeats.


Maximizer is extremely handy with command mappings. The mappings can be defined for normal, insert, and visual modes. Here is the example of the <F3> key usage. You can paste it directly into your .vimrc file.

nnoremap <silent><F3> :MaximizerToggle<CR>
vnoremap <silent><F3> :MaximizerToggle<CR>gv
inoremap <silent><F3> <C-o>:MaximizerToggle<CR>

With these mappings you can hit <F3> any time, not only in normal mode. Other handy situations may include typing some text while you don't fit the current split window or selecting some long lines in the visual mode. Just try it yourself.

Maximizer respects minimal allowed window size, both vertically and horizontally. By default the minimal window height and width are set to 1. You can change those values by tweaking 'winminheight' ('wmh') and 'winminwidth' ('wmw') settings in your .vimrc.

Author and License

Maximizer was written by Szymon Wrozynski. It is licensed under the same terms as Vim itself.

Copyright 2012 Szymon Wrozynski. See :help license
install details

Place in ~/.vim/plugin/maximizer.vim or in case of Pathogen:

cd ~/.vim/bundle
git clone https://github.com/szw/vim-maximizer.git

The most recent version can be found here: https://github.com/szw/vim-maximizer

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-maximizer.zip 1.0.1 2012-12-31 7.0 Szymon Wrozynski Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.