diff options
Diffstat (limited to 'Emacs/.config/emacs/config.org')
-rw-r--r-- | Emacs/.config/emacs/config.org | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index e06745c..75c69c5 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -1686,13 +1686,31 @@ so it looks a bit nicer and add pretty symbols to eshell. (recenter)) "k" #'eshell-kill-process)))) :config + (defun +eshell/get-git-properties () + (let* ((git-branch (shell-command-to-string "git branch")) + (is-repo (string= (substring git-branch 0 1) "*"))) + (if (not is-repo) + "" + (concat + (nth 2 (split-string git-branch "\n\\|\\*\\| ")) + "<" + (if (string= "" (shell-command-to-string "git status | grep 'up to date'")) + "×" + "✓") + ">")))) + (setq eshell-cmpl-ignore-case t eshell-cd-on-directory t + eshell-banner-message (concat (shell-command-to-string "figlet eshell") "\n") eshell-prompt-function (proc - (concat - (format "[%s]\n" (abbreviate-file-name (eshell/pwd))) - "λ ")) + (let ((properties (+eshell/get-git-properties))) + (concat + "(" + properties + ")" + (format "[%s]\n" (abbreviate-file-name (eshell/pwd))) + "λ "))) eshell-prompt-regexp "^λ ") (+dx/create-toggle-function |