Friday, October 26, 2012

Re: Tmux-style window resizing in vim?

On Fri, Oct 26, 2012 at 9:25 AM, Marco <netuse@lavabit.com> wrote:
> 2012-10-26 Jonathan del Strother:
>
>> By contrast, in vim, <C-w>+ increases the height of the current
>> window. Which I can see the logic of, but the key locations (+/- vs
>> </> for the vertical/horizontal resizing) frustrate me, and if you
>> just remap it to hjkl then it feels like it ought to be using the same
>> resize behaviour as tmux.
>
> Yes, I find that confusing, too. There is probably a solution, but
> since it's a minor issue I never bothered to fix it.
>
>> Other niceties from tmux are that you can press <C-b>jjjjj to carry on
>> resizing, whereas in vim you'd have to use
>> <C-w>+<C-w>+<C-w>+<C-w>+<C-w>+.
>
> I have set the following in my .vimrc
>
> map <silent> <A-h> <C-w><
> map <silent> <A-j> <C-W>-
> map <silent> <A-k> <C-W>+
> map <silent> <A-l> <C-w>>
>
> With these mappings you can press Alt+ movement key to easily
> resize. You can also say, e.g. 30<A-h> which increases by a larger
> amount or simply keep <A-h> pressed for a few seconds.

I've found your mappings a neat solution Marco. I've made a little
adjustment for my setup though:

map <silent> <A-j> <C-W>+
map <silent> <A-k> <C-W>-

Thanks.

>
>
> Marco
>
>
> --
> 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

--
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: