diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-09-14 00:24:46 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-09-14 00:47:16 +0100 |
commit | 3550b34cc06d102412fb045d4cb04aec139d2a72 (patch) | |
tree | 4def10fbd5ba152e010e44050964c2ddb7be2fbc /Emacs/.config | |
parent | 81d25daf6192709504867509f2004106e27c6c95 (diff) | |
download | dotfiles-3550b34cc06d102412fb045d4cb04aec139d2a72.tar.gz dotfiles-3550b34cc06d102412fb045d4cb04aec139d2a72.tar.bz2 dotfiles-3550b34cc06d102412fb045d4cb04aec139d2a72.zip |
(Emacs)+eshell extra functionality to eshell
+ Nicer prompt which shows git information on the fly.
+ Cute figlet banner for start of eshell
Pretty nifty!
Diffstat (limited to 'Emacs/.config')
-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 |