sponsor Vim development Vim logo Vim Book Ad

autoresize.vim : Automatically Resizing Splitted Current Window Size Larger.

 script karma  Rating 3/2, Downloaded by 1119  Comments, bugs, improvements  Vim wiki

created by
omi taku
 
script type
utility
 
description
Overview
--------
This plugin updates vim splitted window size automatically large.
Current window size will be large, and the other window size will be
small.

Installation
------------
1. Copy the autoresize.vim script to the $HOME/.vim/plugin or
   the $HOME/vimfiles/plugin. Refer to the ':help add-plugin',
   ':help add-global-plugin' and ':help runtimepath' topics for
   more details about Vim plugins.
2. Restart Vim.

Usage
-----
1. Split vim window, and so current window height or width is automatically
   updated with large value.
2. You move cursor to the other window from one, the other window size is
   automatically updated.
3. If you check this script,
   split vim window with ":split" or ":vsplit",
   and push <C-W><C-W><C-W><C-W><C-W><C-W>....

Configuration
-------------
1. Minimum window size.
   Script use "g:AUTORESIZE_ANOTHER_WINDOW_HEIGHT" variables when you split window
   horizontally.  If you split window vertically then, script use
   "g:AUTORESIZE_ANOTHER_WINDOW_WIDTH" variables.
   These variables are used as the other window size parameter. (not a current)

   example.
       :let g:AUTORESIZE_ANOTHER_WINDOW_HEIGHT = 5
       :let g:AUTORESIZE_ANOTHER_WINDOW_WIDTH = 12

2. Disable script defined autocommands.
   Script add 1 autocommand to your vim environment.
   If you want make this autocommand disable,
   set "g:AUTORESIZE_AUTOCMD_DISABLE" variables to "1".

   example.
       :let g:AUTORESIZE_AUTOCMD_DISABLE = 1

3. Run autocommand in specific filetype.
   If you use this script only in some filetype, add this autocommand to your vimrc.

   example.
       :let g:AUTORESIZE_AUTOCMD_DISABLE = 1
       :autocmd WinEnter *.txt :AutoWindowResize

4. Run script on your action
   If you run this script with some your action (for example, push F4),
   add this configuration to your vimrc.

   example.
       :let g:AUTORESIZE_AUTOCMD_DISABLE = 1
       :nmap <F4> :AutoWindowResize<CR>

Limitation
----------
1. This script will run only on 2 window. Vim run on 3 splitted window,
   on 4 splitted window, or on 1 window then, this script is not running.
 
install details
Copy autoresize.vim to your plugin directory.
 

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
autoresize.vim 0.7 2007-11-29 7.0 omi taku Initial upload
ip used for rating: 142.132.191.50

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.
   
Vim at Github