C.J.
C.J.

Reputation: 249

How to map CTRL+Tab in vim Mac OSX Terminal

I'm trying to make Firefox keybindings work for tabs in vim (ssh'd into a server through OSX Terminal), however I'm running into issues.

Its basically the same as this Stack Overflow question except for Terminal in Mac not xterm:

Mapping <C-Tab> in my vimrc fails in Ubuntu

From my research, it seems some terminals don't differentiate between <C+Tab> and <Tab>, so I'm wondering if there's some way to hack around this in the Terminal app so vim can understand it. (Maybe escape sequences or something...)

Any ideas?

Upvotes: 3

Views: 2478

Answers (2)

LeoNerd
LeoNerd

Reputation: 8532

Long story short: Ctrl-Tab doesn't exist, because Tab is really already a Control key, Ctrl-i.

Short story longer: There is a way to do it, but it requires a sufficiently large amount of hackery at both the terminal and the vim level that you may or may not consider it worth it. I'm working on a much better more generic solution to it but currently I'm not quite sure the world seems to want it.

http://www.leonerd.org.uk/hacks/fixterms/ if you are interested.

Upvotes: 3

romainl
romainl

Reputation: 196516

In Terminal.app's preferences, you can set some keybindings to send specific character sequences. In your case, you could set <C-Tab to send gt or whatever Vim shortcut you want.

Anyway, you'd better learn the right shortcuts.

Upvotes: 1

Related Questions