diff --git a/init.el b/init.el index 9bde3ca..06e8816 100644 --- a/init.el +++ b/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)))