diff options
| author | bh <qn+git@excalibur.computer> | 2025-12-19 21:42:23 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2025-12-19 21:42:23 +0800 |
| commit | 9354ac3a120c0945702b70db2a87defb9723c459 (patch) | |
| tree | 18304763c9799af8912afd6760097ec5ff0794b1 | |
| parent | 70e917d344f92c712a5b812ece5fa1a30a8eb687 (diff) | |
Fixed the 'e' command in eshell
| -rw-r--r-- | config/eshell.el | 10 | ||||
| -rw-r--r-- | init.el | 18 |
2 files changed, 21 insertions, 7 deletions
diff --git a/config/eshell.el b/config/eshell.el index 740c560..620388b 100644 --- a/config/eshell.el +++ b/config/eshell.el @@ -123,9 +123,13 @@ "ls -lah (all files) with optional arguments." (apply #'eshell/ls "-lah" args)) -(defun eshell/e (file) - "Open FILE in Emacs." - (find-file file)) +(defun eshell/e (&rest args) + "Open a file in Emacs." + ; (if (null args) + ; (bury-buffer) + (mapc #'find-file + (mapcar #'expand-file-name + (eshell-flatten-list (reverse args))))) ;) (defun eshell/d (&optional dir) "Open dired in DIR (or current directory)." @@ -73,11 +73,21 @@ ring-bell-function 'ignore) ;; Configure line numbers with themed colors -;; Only show line numbers in text/code buffers, not special buffers (treemacs, magit, etc.) -(add-hook 'prog-mode-hook 'display-line-numbers-mode) -(add-hook 'text-mode-hook 'display-line-numbers-mode) -(add-hook 'fundamental-mode-hook 'display-line-numbers-mode) +;; Enable globally, then disable in specific modes +(global-display-line-numbers-mode 1) (setq display-line-numbers-type 'relative) ;; Relative line numbers for Evil mode + +;; Disable line numbers in special buffers +(dolist (mode '(org-mode-hook + term-mode-hook + shell-mode-hook + eshell-mode-hook + treemacs-mode-hook + magit-mode-hook + help-mode-hook + dired-mode-hook)) + + (add-hook mode (lambda () (display-line-numbers-mode 0)))) (set-face-attribute 'line-number nil :foreground "#4fa8a8" ;; Softer cyan for line numbers :background "#003636") |
