Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to map sequence with CTRL-Shift in gnome-terminal?

I'm trying to add mappings:

map <C-S-[> gT

map <C-S-]> gt

And it's not working. How to do that?

Somehow I mapped <C-S-]>, but it turned out it's not <C-S-]>, but <C-]>, so it looks like it doesn't recognize Shift in this sequence. It's misconfigured or it's gnome-terminal's fault?

Besides. Mapping <C-[>, after pressed, looks like vim is waiting. I suppose it's mapping timeout, but how to get rid of this timeout when I press precisely <C-[> and I don't want to press anything else?

I just started learning vim, so sorry if there is something obviously wrong in that mappings.

share|improve this question

3 Answers 3

I think the problem here is that you are trying to get vim, which expects to run in a terminal, to recognize a CTRL-SHIFT sequence. While it's possible for X to recognize such combinations, applications that run in a terminal (or, these days, a terminal emulator) cannot. This is because, historically, terminals could only send and receive seven- or eight-bit sequences of ASCII data across a serial connection (though this could include "escape sequences" that position the cursor, scroll or delete lines, change color and other helpful effects).

There are 32 "Control Codes" in the ASCII character set, including the familiar CTRL-A through CTRL-Z. But there are no corresponding ASCII codes for "CTRL-SHIFT" A through Z. Now, gnome-terminal itself can recognize these codes (CTRL-SHIFT-V, for instance, will paste text from the clipboard), but vim will not be able to have direct access to it.

Of course, it may be possible (I don't know) for a terminal emulator to be set up to convert CTRL-SHIFT key presses to an escape sequence which can then be recognized by a vim mapping.

=======

UPDATE

You might be interested in gvim, which is a graphical version of vim that runs as an X program rather than a terminal program. Maybe gvim will be able to understand CTRL-SHIFT codes?

share|improve this answer

seems to be an issue with the gnome terminal, not allowing certain combinations with the ctrl-key. google shows a lot of this.

just in case you don't konw it, ctrl-page up/down cycles through tabs.

share|improve this answer

It seems you just have to disable all keyboard shortcuts in gnome-terminal.

share|improve this answer
2  
Why does disabling keyboard shortcuts help? –  Eliah Kagan Jan 24 '13 at 1:45
    
It does not seem to help at all, from my experience. –  Elliot Foster Mar 25 at 21:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.