Skip to main content
2 of 4
edited tags

Trouble overriding Control-i

I want to make Control-i perform indent-region (basically since Xcode has built that muscle memory already).

I realise that Control-i and tab are indistinguishable in the Ascii sense, but they are in the keycode sense.

I've tried the obvious:

(global-unset-key (kbd "C-i"))
(global-set-key (kbd "C-i") 'indent-region)

to no avail - pressing Control-i still just does whatever the tab key does in the current context. Is there anything I can do to help Emacs treat the tab button differently to Control-i?

Update: I guess an equivalent outcome would be achieved by being able to remap what a tab/Control-i press does when a region is selected.

Mark
  • 1.4k
  • 1
  • 16
  • 21