summaryrefslogtreecommitdiffstats
path: root/.emacs.d/init.org
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2019-04-14 16:01:36 -0400
committerAmin Bandali <bandali@gnu.org>2019-04-14 16:01:36 -0400
commitcd7a784e5b0b0624a09d5520fd6482a545f8bef6 (patch)
tree316d4b97c74a13a9811063d1e78a5e2871f1a53d /.emacs.d/init.org
parentd99f86cd913e15a2dc5792ca382fb5d4b2abeb7b (diff)
downloadconfigs-cd7a784e5b0b0624a09d5520fd6482a545f8bef6.tar.gz
configs-cd7a784e5b0b0624a09d5520fd6482a545f8bef6.tar.xz
configs-cd7a784e5b0b0624a09d5520fd6482a545f8bef6.zip
emacs: update eshell prompt to match my bash prompt
Diffstat (limited to '.emacs.d/init.org')
-rw-r--r--.emacs.d/init.org24
1 files changed, 6 insertions, 18 deletions
diff --git a/.emacs.d/init.org b/.emacs.d/init.org
index d02ed3b..77d5144 100644
--- a/.emacs.d/init.org
+++ b/.emacs.d/init.org
@@ -2133,29 +2133,17 @@ Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
:defer 0.5
:after eshell
:config
+ (defvar user-@-host (concat (user-login-name) "@" (system-name) " "))
(defun +eshell/prompt ()
(let ((base/dir (shrink-path-prompt default-directory)))
- (concat (propertize (car base/dir)
+ (concat (propertize user-@-host 'face 'default)
+ (propertize (car base/dir)
'face 'font-lock-comment-face)
(propertize (cdr base/dir)
'face 'font-lock-constant-face)
- (propertize (+eshell--current-git-branch)
- 'face 'font-lock-function-name-face)
- "\n"
- ;; "λ"
- ;; (propertize "λ" 'face 'eshell-prompt)
- ;; needed for the input text to not have prompt face
- (propertize "λ " 'face 'default))))
-
- (defun +eshell--current-git-branch ()
- (let ((branch (car (loop for match in (split-string (shell-command-to-string "git branch") "\n")
- when (string-match "^\*" match)
- collect match))))
- (if (not (eq branch nil))
- (concat " " (substring branch 2))
- "")))
- (setq eshell-prompt-regexp "\\(.*\n\\)*λ "
- eshell-prompt-function #'+eshell/prompt))
+ (propertize "> " 'face 'default))))
+ (setq eshell-prompt-regexp (concat user-@-host ".*> ")
+ eshell-prompt-function #'+eshell/prompt))
#+end_src
** [[https://github.com/peterwvj/eshell-up][eshell-up]]