-
-
Save martialboniou/1358281 to your computer and use it in GitHub Desktop.
bind f1, f2, f3 and f4 in emacs term
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun term-send-function-key () | |
(interactive) | |
(let* ((char last-input-event) | |
(output (cdr (assoc char term-function-key-alist)))) | |
(term-send-raw-string output))) | |
(defconst term-function-key-alist '((f1 . "\e[OP") | |
(f2 . "\e[OQ") | |
(f3 . "\e[OR") | |
(f4 . "\e[OS"))) | |
(dolist (spec term-function-key-alist) | |
(define-key term-raw-map | |
(read-kbd-macro (format "<%s>" (car spec))) | |
'term-send-function-key)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment