Thursday, July 12, 2012

Re: how to resize window (width) continuously ?

Am 12.07.2012 03:16, schrieb chris:
> Excerpts from [ Andy Wokula ] //// On [2012-07-11 19:33:24 +0200]:
>
>> Am 06.06.2012 03:18, schrieb stardiviner:
>>> In vim, how to adjust window height or width continuously ?
>>> For example,
>>> press `C-w -` and `-` and `-` to decrease window height again and again,
>>> But this seems can not work in Vim.
>
>>> So is there a good and simple way to do this ?
>
>> There is a way:
>
>> set timeoutlen=3000 " 1 second times out too soon
>> set showcmd " mode prefix in lower right corner
>
>> nmap<C-W>+<C-W>+<SID>winheight
>> nmap<C-W>-<C-W>-<SID>winheight
>> nn<script> <SID>winheight+<C-W>+<SID>winheight
>> nn<script> <SID>winheight-<C-W>-<SID>winheight
>> nmap<SID>winheight<Nop>
>
>> See also submode and tinymode.vim (the latter by me).
> This one is better. Also how to use this way to adjust window width ?

In the same way:


set timeoutlen=3000 " 1 second is too short
set showcmd " mode prefix in lower right corner

nmap <C-W>+ <C-W>+<SID>winsize
nmap <C-W>- <C-W>-<SID>winsize
nmap <C-W>< <C-W><<SID>winsize
nmap <C-W>> <C-W>><SID>winsize
nn <script> <SID>winsize+ <C-W>+<SID>winsize
nn <script> <SID>winsize- <C-W>-<SID>winsize
nn <script> <SID>winsize< 5<C-W><<SID>winsize
nn <script> <SID>winsize> 5<C-W>><SID>winsize
nmap <SID>winsize <Nop>


Tinymode also includes a mode for this purpose (with some extras).

--
Andy

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: