tlib_vim icon indicating copy to clipboard operation
tlib_vim copied to clipboard

Map <C-j> and <C-k> to <down>/<up> (input#ListW at least)

Open blueyed opened this issue 14 years ago • 3 comments

At least with tlib#input#ListW C-j and C-k should be mapped to and respectively.

I might be missing something, but also according to the help (via ?), only and itself work for selecting an item.

blueyed avatar Mar 21 '11 17:03 blueyed

IIRC this won't work because c-j is the same as LF and c-k is VT (which probably is the lesser problem). I was thinking about making tlib#input mode aware but this doesn't seem very useful to me.

I don't understand the second statement. May I kindly ask if you could rephrase your question.

tomtom avatar Mar 21 '11 18:03 tomtom

I have not looked at the internals of tlib#input, but I've thought that vim mappings could/would get used there. Obviously this isn't the case. What about C-P and C-N then, if the former is not possible?

In the second statement I've meant to say that the help only mentions the standard cursor keys, nothing really relevant.

blueyed avatar Mar 21 '11 22:03 blueyed

Basically, you can easily add new maps by adding these lines to ~/.vim/after/plugin/02tlib.vim:

let g:tlib_keyagents_InputList_s[KEY_DOWN] = 'tlib#agent#Down' let g:tlib_keyagents_InputList_s[KEY_UP] = 'tlib#agent#Up'

The main problem is that free control key maps are rare. Many generate the same code as some often used key (BS, CR etc.). Others are already used by other plugins. A users mapped the UP/DOWN to tab/s-tab.

It seems c-n, c-p aren't that problematic per se but they are already used by other plugins. Maybe some mode-awareness would be a better solution on the long run?

tomtom avatar Mar 22 '11 07:03 tomtom