Use shrink-path on eshell PWD in default prompt
Makes longer paths easier to deal with.
This commit is contained in:
parent
2addfebf8e
commit
a4ccc2fc81
3 changed files with 8 additions and 1 deletions
|
@ -63,7 +63,9 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +eshell-prompt ()
|
(defun +eshell-prompt ()
|
||||||
"Generate the prompt string for eshell. Use for `eshell-prompt-function'."
|
"Generate the prompt string for eshell. Use for `eshell-prompt-function'."
|
||||||
(concat (propertize (abbreviate-file-name (eshell/pwd)) 'face '+eshell-prompt-pwd)
|
(concat (if (bobp) "" "\n")
|
||||||
|
(propertize (abbreviate-file-name (shrink-path-file (eshell/pwd)))
|
||||||
|
'face '+eshell-prompt-pwd)
|
||||||
(propertize (+eshell--current-git-branch) 'face '+eshell-prompt-git-branch)
|
(propertize (+eshell--current-git-branch) 'face '+eshell-prompt-git-branch)
|
||||||
(propertize " λ " 'face '+eshell-prompt-char)))
|
(propertize " λ " 'face '+eshell-prompt-char)))
|
||||||
|
|
||||||
|
|
|
@ -91,3 +91,7 @@ redefines its keys every time `eshell-mode' is enabled."
|
||||||
|
|
||||||
(def-package! eshell-up
|
(def-package! eshell-up
|
||||||
:commands (eshell-up eshell-up-peek))
|
:commands (eshell-up eshell-up-peek))
|
||||||
|
|
||||||
|
|
||||||
|
(def-package! shrink-path
|
||||||
|
:commands shrink-path-file)
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
;;; emacs/eshell/packages.el
|
;;; emacs/eshell/packages.el
|
||||||
|
|
||||||
(package! eshell-up)
|
(package! eshell-up)
|
||||||
|
(package! shrink-path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue