summaryrefslogtreecommitdiff
path: root/emacs/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/init.el')
-rw-r--r--emacs/init.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 950a953..6f12d03 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -246,6 +246,16 @@ back to the previous selected buffer."
(switch-to-prev-buffer)
(eshell arg)))
+(defun my/eshell-clear-or-center (&optional clear)
+ "Either clear the screen or recenter display depending on point location."
+ (interactive "P")
+ (cond
+ (clear (eshell/clear clear))
+ ((>= (point) eshell-last-output-end) ;; at the input line
+ (eshell/clear clear))
+ (t ;; in scroll back somewhere
+ (recenter-top-bottom))))
+
(defun my/vc-on-root (&optional arg)
"Open a vc dir buffer at the project root.
With ARG, open a Dired buffer instead."
@@ -416,7 +426,7 @@ With ARG, don't save the current layout."
(require 'em-term)
(setup-esh-help-eldoc)
:bind (:map eshell-mode-map
- ("C-l" . eshell/clear)) ; todo make smarter with centering
+ ("C-l" . my/eshell-clear-or-center)) ; todo make smarter with centering
:hook (eshell-mode . eldoc-mode))
(use-package ediff ; emacs interactive diff
@@ -541,7 +551,7 @@ With ARG, don't save the current layout."
'(:weight bold :foreground "green2")
t str)
str)))))
- (push dir global-mode-string)))
+ (add-to-list 'mode-line-misc-info dir)))
(progn ; comfy scratch buffer
(require 'iimage)