Skip to content

Instantly share code, notes, and snippets.

@joelmccracken
Created March 29, 2014 18:10
Show Gist options
  • Save joelmccracken/9859284 to your computer and use it in GitHub Desktop.
Save joelmccracken/9859284 to your computer and use it in GitHub Desktop.
execute a single key combo when in term character mode in emacs
(defun jnm/single-command-outside-of-term-mode ()
(interactive)
(cl-flet ((do-cmd ()
(call-interactively (key-binding (read-key-sequence "key sequence: ")))))
(if (term-in-line-mode)
(do-cmd)
(term-line-mode)
(do-cmd)
(term-char-mode))))
(define-key term-raw-map (kbd "C-c C-u") 'jnm/single-command-outside-of-term-mode)
(define-key term-mode-map (kbd "C-c C-u") 'jnm/single-command-outside-of-term-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment