Friday, September 10, 2010

Re: Multiple lines different only in 2 words. How ?

On Fri, September 10, 2010 9:56 am, Andriy Y wrote:
> On Fri, Sep 10, 2010 at 9:50 AM, Christian Brabandt
>> On Fri, September 10, 2010 9:05 am, Andriy Y wrote:
>> for i in ['Right', 'Left', 'U','D', 'h','j','k','l']| call append('$',
>> "nnoremap <M-".i."> <C-W><".i.">")|endfor

BTW: this does not work as expected. The problem is, that for example
<M-U> will be mapped to <C-W><U> which is not what you want.

> I'm trying to remap keys like <C-W><Left> - move to buffer on the left.
> These are built-in - in the meaning they are a part of VIM, not a plugin.

This is a quick hack. I am not sure, this will map everthing, but try that:
#v+
let a=readfile(expand("$VIMRUNTIME/doc/windows.txt"))
call filter(a, 'v:val =~ ''^CTRL-W .\>\s\s\+''')
call map(a, 'split(v:val, ''\s\s\+'')[0]')
call map(a, 'substitute(v:val, ''CTRL-W \(.\)'',
\''noremap <M-\1> <C-W>\1'', "")')
for key in a|exe key|endfor
#v-
This may or may not be what you want. I didn't test it. I am not even
sure, that Meta combos like those are even remappable. You need to find
out, if they work.

regards,
Christian

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

Post a Comment