diff options
| author | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-01-25 18:33:19 -0800 |
|---|---|---|
| committer | Thomas Ulmer <thomasmulmer02@gmail.com> | 2026-01-25 18:33:19 -0800 |
| commit | 0f3af4d2cfe728eb89320c9656fc061a7da5ee1e (patch) | |
| tree | f1867b9f21d6ed6e09eca5618675ed4b6853ef37 /emacs/init.el | |
| parent | 749d87bec0aa8595c232865000a04c9434105d90 (diff) | |
emacs eshell clear and modeline dir
Diffstat (limited to 'emacs/init.el')
| -rw-r--r-- | emacs/init.el | 14 |
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) |
