[EShell] Trying to make the prompt look nicer

With inspiration from Howard Abrams’ Emacs configuration
This commit is contained in:
Daniel - 2018-07-19 13:49:26 +02:00
parent cf4a07d8d6
commit 1126f85c6c
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 20 additions and 9 deletions

View File

@ -45,15 +45,26 @@
(add-to-list 'eshell-command-completions-alist
'("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'"))
(setq eshell-prompt-function
(lambda ()
(concat
"[" (user-login-name)
"@" (getenv "HOST")
":" (abbreviate-file-name (eshell/pwd))
"]\n"))
eshell-prompt-regexp
"^→ ")
(defun eshell/default-prompt-function ()
"A prompt for eshell of the form
[$USER@$HOST] [$PWD]
"
(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
'with-editor-export-editor)