[EShell] Trying to make the prompt look nicer
With inspiration from Howard Abrams’ Emacs configuration
This commit is contained in:
parent
cf4a07d8d6
commit
1126f85c6c
|
@ -45,15 +45,26 @@
|
||||||
(add-to-list 'eshell-command-completions-alist
|
(add-to-list 'eshell-command-completions-alist
|
||||||
'("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'"))
|
'("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'"))
|
||||||
|
|
||||||
(setq eshell-prompt-function
|
(defun eshell/default-prompt-function ()
|
||||||
(lambda ()
|
"A prompt for eshell of the form
|
||||||
(concat
|
|
||||||
"[" (user-login-name)
|
┌[$USER@$HOST] [$PWD]
|
||||||
"@" (getenv "HOST")
|
└──
|
||||||
":" (abbreviate-file-name (eshell/pwd))
|
|
||||||
"]\n→ "))
|
"
|
||||||
eshell-prompt-regexp
|
(let ((head-face '(:foreground "#859900")))
|
||||||
"^→ ")
|
(format (concat (propertize "┌" 'face head-face)
|
||||||
|
"[%s@%s] [%s]\n"
|
||||||
|
(propertize "└──" 'face head-face)
|
||||||
|
" ")
|
||||||
|
(user-login-name)
|
||||||
|
(system-name)
|
||||||
|
(propertize (abbreviate-file-name (eshell/pwd))
|
||||||
|
'face '(:foreground "#dc322f")))))
|
||||||
|
|
||||||
|
(setq eshell-prompt-function #'eshell/default-prompt-function
|
||||||
|
eshell-prompt-regexp "└── "
|
||||||
|
eshell-highlight-prompt nil)
|
||||||
|
|
||||||
(add-hook 'eshell-mode-hook
|
(add-hook 'eshell-mode-hook
|
||||||
'with-editor-export-editor)
|
'with-editor-export-editor)
|
||||||
|
|
Loading…
Reference in New Issue