emacs global-set-key C-i

0

I want to remap a few commands in emacs as follows:

(global-set-key "\C-i" 'backward-word)
(global-set-key "\C-o" 'forward-word)

This works well except the TAB key is somehow bound to C-i as well and so the functionality of my TAB no performs the backward-word command and thus no longer works. This is definitely a problem when editing python code...

  1. How can I fix this?
  2. I know about some of the help documents C-h k and C-h v but where would I have learned about the TAB key issue?

CodeKingPlusPlus

Posted 2013-06-26T01:57:15.153

Reputation: 261

There is an excellent explanation of this at http://stackoverflow.com/questions/1792326/how-do-i-bind-a-command-to-c-i-without-changing-tab

– Alan Shutko – 2013-06-26T02:14:59.797

That doesn't work for me. I am using OS X 10.8.4 with emacs 24.3 through the terminal – CodeKingPlusPlus – 2013-06-26T11:36:00.083

That's the problem. The terminal treats C-i and TAB as the same character, and there's no way to change it. You'll need to use a version of Emacs outside the terminal. – Alan Shutko – 2013-06-26T12:20:35.923

You can't customize that or remap? – CodeKingPlusPlus – 2013-06-26T17:11:59.597

Not in Emacs. The terminal sends exactly the same sequences either way. Depending on your terminal emulator, you might be able to send different sequences. – Alan Shutko – 2013-06-26T17:48:13.537

If you are using a fairly recent version of Yasnippet, you will need to remove the keymapping within each snippet if any snippet uses C-i in a mode where you want the tab key to do something else besides activate a snippet. Just one snippet with C-i is enough to prevent using the tab key for something else. – lawlist – 2013-06-30T01:00:52.043

No answers