Properly handle tab and backtab in kkp-enabled terminals
This commit is contained in:
parent
71fb77f758
commit
4dc28f50d7
10
init.el
10
init.el
@ -372,6 +372,15 @@ directory. Otherwise, run `find-file' on that file."
|
||||
:bind ("C-q" . my/quoted-insert)
|
||||
:config
|
||||
(global-kkp-mode 1)
|
||||
(defun my/-kkp-after-terminal-setup (&rest _)
|
||||
;; Make tab and backtab work properly
|
||||
(define-key input-decode-map [(control ?i)] [tab])
|
||||
(define-key input-decode-map [(control ?I)] [backtab]))
|
||||
(defun my/-kkp-after-terminal-teardown (&rest _)
|
||||
(define-key input-decode-map [(control ?i)] nil t)
|
||||
(define-key input-decode-map [(control ?I)] nil t))
|
||||
(advice-add 'kkp--terminal-setup :after 'my/-kkp-after-terminal-setup)
|
||||
(advice-add 'kkp--terminal-teardown :after 'my/-kkp-after-terminal-teardown)
|
||||
(defun my/quoted-insert (arg)
|
||||
"Insert the next character using read-key, not read-char."
|
||||
(interactive "*p")
|
||||
@ -385,6 +394,7 @@ directory. Otherwise, run `find-file' on that file."
|
||||
(while (> arg 0)
|
||||
(insert-and-inherit char)
|
||||
(setq arg (1- arg))))))
|
||||
|
||||
(defun my/-kkp-fix-save-some-buffers (oldfun &optional arg pred)
|
||||
"Fix `save-some-buffers' when used in a terminal with kkp enabled."
|
||||
(let ((status (kkp--terminal-has-active-kkp-p)))
|
||||
|
Loading…
Reference in New Issue
Block a user