Distinguish <C-i> from "C-i"

This commit is contained in:
Henrik Lissner 2020-12-11 01:44:41 -05:00
parent a3b8be52a8
commit 96d7e50f3e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 12 additions and 1 deletions

View file

@ -39,6 +39,15 @@ and Emacs states, and for non-evil users.")
(setq w32-lwindow-modifier 'super
w32-rwindow-modifier 'super)))
;; HACK Fixes Emacs' disturbing inability to distinguish C-i from TAB.
(define-key key-translation-map [?\C-i]
(cmd! (if (and (not (cl-position 'tab (this-single-command-raw-keys)))
(not (cl-position 'kp-tab (this-single-command-raw-keys)))
(display-graphic-p))
[C-i] [?\C-i])))
;; However, ensure <C-i> falls back to the old keybind if it has no binding.
(global-set-key [C-i] [?\C-i])
;;
;;; Universal, non-nuclear escape

View file

@ -20,7 +20,7 @@ directives. By default, this only recognizes C directives.")
;; Set these defaults before `evil'; use `defvar' so they can be changed prior
;; to loading.
(defvar evil-want-C-g-bindings t)
(defvar evil-want-C-i-jump (or (daemonp) (display-graphic-p)))
(defvar evil-want-C-i-jump nil)
(defvar evil-want-C-u-scroll t) ; moved the universal arg to <leader> u
(defvar evil-want-C-u-delete t)
(defvar evil-want-C-w-scroll t)
@ -419,6 +419,8 @@ directives. By default, this only recognizes C directives.")
;; zu{q,w} - undo last marking
(map! :v "@" #'+evil:apply-macro
:m [C-i] #'evil-jump-forward
:m [tab] #'evil-jump-item
;; implement dictionary keybinds
;; evil already defines 'z=' to `ispell-word' = correct word at point