summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-04-19 22:35:58 +0200
committerGravatar Tom Willemse2014-04-19 22:35:58 +0200
commit75b7a08c4295834d538cbc0a8425ce9a5627617e (patch)
treea9b964d248ac011b7bf636c59205c2b7ce904890
parentb8b6e1685db72fc1c3b6a031c5ec64b54ae0f1a1 (diff)
downloademacs-75b7a08c4295834d538cbc0a8425ce9a5627617e.tar.gz
emacs-75b7a08c4295834d538cbc0a8425ce9a5627617e.zip
Fix an ansi-term keybinding which was bugging me
-rw-r--r--.emacs.d/init.org18
1 files changed, 18 insertions, 0 deletions
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-<backspace>") (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