From 75b7a08c4295834d538cbc0a8425ce9a5627617e Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 19 Apr 2014 22:35:58 +0200 Subject: Fix an ansi-term keybinding which was bugging me --- .emacs.d/init.org | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to '.emacs.d/init.org') diff --git a/.emacs.d/init.org b/.emacs.d/init.org index d49ce55..d785448 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -244,6 +244,24 @@ (setq desktop-restore-eager 5) #+END_SRC +* Fix some term keybindings + + =ansi-term= passes along a lot of characters correctly, but things + like =forward-delete-word= are not, by default. This is confusing when + you see one thing and another is sent. Passing the correct keys + directly to the terminal fixes this problem. + + #+BEGIN_SRC emacs-lisp + (defun oni:set-term-keys () + (cl-flet ((zcommand (key) + (lambda () + (interactive) (term-send-raw-string key)))) + (define-key term-raw-map + (kbd "C-") (zcommand "\C-H")))) + + (add-hook 'term-mode-hook #'oni:set-term-keys) + #+END_SRC + * Footnotes [fn:1] https://github.com/sabof/svg-mode-line-themes -- cgit v1.2.3-54-g00ecf