Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to map "Ctrl+>" combination in vim?

I want to map the CTRL> combination to gt (go to next vim tab).

Because > is a special character, nmap <c->> gt does not work.

How can I achieve the desired result?

like image 726
ilstam Avatar asked Jan 02 '13 13:01

ilstam


2 Answers

Due to the way that the keyboard input is handled internally, this unfortunately isn't generally possible today, even in GVIM. Some key combinations, like Ctrl + non-alphabetic cannot be mapped, and Ctrl + letter vs. Ctrl + Shift + letter cannot be distinguished. (Unless your terminal sends a distinct termcap code for it, which most don't.) In insert or command-line mode, try typing the key combination. If nothing happens / is inserted, you cannot use that key combination. This is a known pain point, and the subject of various discussions on vim_dev and the #vim IRC channel.

Some people (foremost Paul LeoNerd Evans) want to fix that (even for console Vim in terminals that support this), and have floated various proposals.

But as of today, no patches or volunteers have yet come forward, though many have expressed a desire to have this in a future Vim 8 major release.

like image 177
Ingo Karkat Avatar answered Sep 30 '22 23:09

Ingo Karkat


You can map every key by its termcap code. And by decimal (octal, hexa) code. Please read:

:h :map-special-chars
like image 29
Zsolt Botykai Avatar answered Sep 30 '22 23:09

Zsolt Botykai