summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemacs.org29
1 files changed, 29 insertions, 0 deletions
diff --git a/emacs.org b/emacs.org
index 6d44531..7cea165 100755
--- a/emacs.org
+++ b/emacs.org
@@ -1058,7 +1058,36 @@ Create function to watch videos using ~mpv~
#+end_src
** Prompt
#+begin_src emacs-lisp
+ ;; customize multiline theme
+ (defun eshell-git-prompt-multiline ()
+ "Eshell Git prompt inspired by spaceship-prompt."
+ (let (separator hr dir git git-dirty time sign command)
+ (setq separator (with-face " | " 'eshell-git-prompt-multiline-secondary-face))
+ (setq hr (with-face (concat "\n" (make-string (/ (window-total-width) 2) ?─) "\n") 'eshell-git-prompt-multiline-secondary-face))
+ (setq dir
+ (concat
+ (concat (abbreviate-file-name (eshell/pwd)))))
+ (setq git
+ (concat (with-face "⎇" 'eshell-git-prompt-exit-success-face)
+ (concat (eshell-git-prompt--branch-name))))
+ (setq git-dirty
+ (when (eshell-git-prompt--branch-name)
+ (if (eshell-git-prompt--collect-status)
+ (with-face " ✎" 'eshell-git-prompt-modified-face)
+ (with-face " ✔" 'eshell-git-prompt-exit-success-face))))
+ (setq time (with-face (format-time-string "%I:%M:%S %p") 'eshell-git-prompt-multiline-secondary-face))
+ (setq sign
+ (if (= (user-uid) 0)
+ (with-face "\n#" 'eshell-git-prompt-multiline-sign-face)
+ (with-face "\nλ" 'eshell-git-prompt-multiline-sign-face)))
+ (setq command (with-face " " 'eshell-git-prompt-multiline-command-face))
+
+ ;; Build prompt
+ (eshell-git-prompt---str-read-only
+ (concat hr dir separator git git-dirty separator time sign command))))
+
(eshell-git-prompt-use-theme 'multiline)
+
(eshell-syntax-highlighting-global-mode 1)
(setq eshell-highlight-prompt t)