How to use ctrl-i for emacs shortcut without tabbing

Possible duplicate:
How to associate a command with Ci without changing the TAB?

I want to override the emacs-i shortcut control to be "MOVE CURSOR"

To do this, I added the following line to the .emacs file:

(global-set-key (kbd "C-i") 'previous-line)

What I discovered then is that the default tab key does everything related to control-i, which is clearly not what I want. Thus, in order to restore the normal behavior of the tab, I added this to my .emacs file

(global-set-key (kbd "<tab>") 'indent-for-tab-command)

It basically works. BUT, the tab no longer works for auto-complete commands in the mini-buffer. How can i fix this? Or is there a better way around this? Thank.

+3
2

: C-i TAB?

:

;; Translate the problematic keys to the function key Hyper, 
;; then bind this to the desired ctrl-i behavior
(keyboard-translate ?\C-i ?\H-i)
(global-set-key [?\H-i] 'previous-line)
+2

Control-i TAB (, ). Emacs .

. Emacs TAB C-i.

(local-set-key key binding).
(interactive) .emacs, , .

Edit

: .emacs , M-x eval-current-buffer

  (defun mybinding () 
    (interactive)
    (local-set-key [tab]
      '(lambda () (interactive)
          (message "hello"))))

M-x mybinding, TAB, ( "hello" ).

C-f TAB, , .

+7

Source: https://habr.com/ru/post/1781706/


All Articles