summaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/site-lisp
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-12-17 01:24:36 +0100
committerGravatar Tom Willemse2015-12-17 01:24:36 +0100
commitea35825e1d9d7f81c05b7e96bc903473a37a3ae6 (patch)
treecedb924db332c9ff2bf0e01aca88861a34ee36c7 /emacs/.emacs.d/site-lisp
parent40b26e86cf6eef2d115e3a6335dd87f808885bfd (diff)
downloaddotfiles-ea35825e1d9d7f81c05b7e96bc903473a37a3ae6.tar.gz
dotfiles-ea35825e1d9d7f81c05b7e96bc903473a37a3ae6.zip
Move eshell-C-d to eshell library
Diffstat (limited to 'emacs/.emacs.d/site-lisp')
-rw-r--r--emacs/.emacs.d/site-lisp/oni-eshell.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/emacs/.emacs.d/site-lisp/oni-eshell.el b/emacs/.emacs.d/site-lisp/oni-eshell.el
index c0d3d13..988afd2 100644
--- a/emacs/.emacs.d/site-lisp/oni-eshell.el
+++ b/emacs/.emacs.d/site-lisp/oni-eshell.el
@@ -25,6 +25,7 @@
;;; Code:
(require 'em-dirs)
+(require 'em-prompt)
;;;###autoload
(defun eshell/cdp ()
@@ -49,5 +50,21 @@ directory in it."
'action (lambda (button)
(browse-url (button-label button)))))))
+;;;###autoload
+(defun oni:eshell-C-d ()
+ "Either call `delete-char' interactively or quit."
+ (interactive)
+ (condition-case err
+ (call-interactively #'delete-char)
+ (error (if (and (eq (car err) 'end-of-buffer)
+ (looking-back eshell-prompt-regexp nil))
+ (kill-buffer)
+ (signal (car err) (cdr err))))))
+
+;;;###autoload
+(defun oni:set-keys-for-eshell ()
+ "Set some keybindings for `eshell'."
+ (define-key eshell-mode-map (kbd "C-d") #'oni:eshell-C-d))
+
(provide 'oni-eshell)
;;; oni-eshell.el ends here