sponsor Vim development Vim logo Vim Book Ad

winresizer.vim : very simple vim plugin for easy resizing of your vim windows

 script karma  Rating 54/18, Downloaded by 445    Comments, bugs, improvements  Vim wiki

created by
simeji n
 
script type
utility
 
description
winresizer.vim
================

Very simple vim plugin for easy resizing of your vim windows.

You can resize windows continuously by using typical keymaps of Vim. (`h`, `j`, `k`, `l`)  
The WindowResize mode makes your operation more quickly and more naturally.

## Demo

### For terminal vim

demo

https://raw.github.com/wiki/simeji/winresizer/images/demo-for-terminal.gif

### For MacVim(gui vim)

* MacVim Window resize
* Vim window resize

demo

https://raw.github.com/wiki/simeji/winresizer/images/demo-for-gui.gif

## In default setting

1. You press keys `Ctrl + E` or execute `:WinResizerStartResize` on vim(in normal mode), to run this plugin

2. Start 'window resize mode', and you can resize current vim windows using 'h', 'j', 'k', 'l' keys

3. You want to finish resize mode, then press "Enter" key

4. If you cancel window resize, then press "q" key.
   You will get window size of before change

## Customize options

You can change setting and key mappings by using below options.(in your vimrc)

|variable name|default value|description|
|:-----------|:---------:|:----------|
g:winresizer_enable
   default: 1
   desc:    Use winresizer (If this value is 0, this plugin will not work)

g:winresizer_gui_enable
   default: 0
   desc:    Use winresizer in GUI Vim (If this value is 0, this plugin will not work in GUI Vim such as Mac Vim)

g:winresizer_finish_with_escape
   default: 1
   desc:    If this value is 1, window resize mode is finished(fixed) by `Esc`

g:winresizer_vert_resize
   default: 10
   desc:    The change width of window size when `left` or `right` key is pressed

g:winresizer_horiz_resize
   default: 3
   desc:    The change height of window size when `down` or `up` key is pressed

g:winresizer_start_key
   default: `Ctrl + e`
   desc:    Start window resize mode

g:winresizer_gui_start_key
   default: `Ctrl + a`
   desc:    Start window resize mode (in GUI Vim)

g:winresizer_keycode_left
   default: 104(`h`)
   desc:    Expand window size to left

g:winresizer_keycode_right
   default: 108(`l`)
   desc:    Expand window size to right

g:winresizer_keycode_down
   default: 106(`j`)
   desc:    Expand window size to down

g:winresizer_keycode_up
   default: 107(`k`)
   desc:    Expand window size to up

g:winresizer_keycode_finish
   default: 13(`Enter`)
   desc:    Fix and escape from window resize mode

g:winresizer_keycode_cancel
   default: 113(`q`)
   desc:    Cancel and quit window resize mode


If you want to resize MacVim window itself, you must set below.

```your_vimrc
let g:winresizer_gui_enable = 1
```

#### _Example in your .vimrc_

If you use winresizer with default settings. Don't have to do any settings.

    " If you want to start window resize mode by `Ctrl+T`
    let g:winresizer_start_key = '<C-T>'
    
    " If you cancel and quit window resize mode by `z` (keycode 122)
    let g:winresizer_keycode_cancel = 122

=-=-= [ Cheat sheet ]-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

keymap of [window resize mode] (default setting)

h : expand window size to left
j : expand window size to down
k : expand window size to up
l : expand window size to right
q : cancel resize window and escepe [window resize mode]
Enter : fix and escape

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

## Latest version (development version) and issues

https://github.com/simeji/winresizer

## License
winresizer is released under the MIT license.
 
install details
Just copy this script files autoload/winresizer.vim and plugin/winresizer.vim within Vim's path.

If you are using Vundle or NeoBundle, just add the following line to your .vimrc:

(with Vundle)
""---------------------------------------
Bundle 'simeji/winresizer.git'
'""---------------------------------------

(with NeoBundle)
""---------------------------------------
NeoBundle 'simeji/winresizer.git'
""---------------------------------------
 

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
winresizer.tar.gz 1.1 2016-02-27 7.0 simeji n add function resize for MacVim and other GUI Vim
winresizer.tar.gz 1.0 2013-07-05 7.0 simeji n Add g:winresizer_finish_with_escape option, and edited README.

If don't want to use this function, add below setting in your .vimrc, please.

let g:winresizer_finish_with_escape = 0
winresizer.tar.gz 0.1 2013-05-20 7.0 simeji n Initial upload
ip used for rating: 54.197.66.254

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.
   
SourceForge.net Logo