about summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/init.el b/init.el index 09a864f..6628b29 100644 --- a/init.el +++ b/init.el
@@ -260,7 +260,8 @@
260 260
261(setup eshell 261(setup eshell
262 (:option eshell-directory-name (acdw/dir "eshell/" t) 262 (:option eshell-directory-name (acdw/dir "eshell/" t)
263 eshell-aliases-file (acdw/dir "eshell/aliases" t)) 263 eshell-aliases-file (acdw/dir "eshell/aliases" t)
264 eshell-kill-on-exit nil)
264 265
265 (defun eshell-quit-or-delete-char (arg) 266 (defun eshell-quit-or-delete-char (arg)
266 "Delete the character to the right, or quit eshell on an empty line." 267 "Delete the character to the right, or quit eshell on an empty line."
@@ -269,10 +270,16 @@
269 (eshell-life-is-too-much) 270 (eshell-life-is-too-much)
270 (delete-forward-char arg))) 271 (delete-forward-char arg)))
271 272
272 (global-set-key (kbd "<f12>") #'eshell) 273 (defun eshell-pop-or-quit (&optional buffer-name)
274 "Pop open an eshell buffer, or if in an eshell buffer, bury it."
275 (interactive)
276 (if (eq (current-buffer) (get-buffer (or buffer-name "*eshell*")))
277 (eshell-life-is-too-much)
278 (eshell)))
279
280 (:leader "s" eshell-pop-or-quit)
273 281
274 (hook-defun eshell-setup 'eshell-mode-hook 282 (hook-defun eshell-setup 'eshell-mode-hook
275 (define-key eshell-mode-map (kbd "<f12>") #'bury-buffer)
276 (define-key eshell-mode-map (kbd "C-d") #'eshell-quit-or-delete-char) 283 (define-key eshell-mode-map (kbd "C-d") #'eshell-quit-or-delete-char)
277 (when (boundp 'simple-modeline--mode-line) 284 (when (boundp 'simple-modeline--mode-line)
278 (setq mode-line-format '(:eval simple-modeline--mode-line))))) 285 (setq mode-line-format '(:eval simple-modeline--mode-line)))))