(Emacs)+eshell extra functionality to eshell
+ Nicer prompt which shows git information on the fly. + Cute figlet banner for start of eshell Pretty nifty!
This commit is contained in:
@@ -1686,13 +1686,31 @@ so it looks a bit nicer and add pretty symbols to eshell.
|
|||||||
(recenter))
|
(recenter))
|
||||||
"k" #'eshell-kill-process))))
|
"k" #'eshell-kill-process))))
|
||||||
:config
|
: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
|
(setq eshell-cmpl-ignore-case t
|
||||||
eshell-cd-on-directory t
|
eshell-cd-on-directory t
|
||||||
|
eshell-banner-message (concat (shell-command-to-string "figlet eshell") "\n")
|
||||||
eshell-prompt-function
|
eshell-prompt-function
|
||||||
(proc
|
(proc
|
||||||
(concat
|
(let ((properties (+eshell/get-git-properties)))
|
||||||
(format "[%s]\n" (abbreviate-file-name (eshell/pwd)))
|
(concat
|
||||||
"λ "))
|
"("
|
||||||
|
properties
|
||||||
|
")"
|
||||||
|
(format "[%s]\n" (abbreviate-file-name (eshell/pwd)))
|
||||||
|
"λ ")))
|
||||||
eshell-prompt-regexp "^λ ")
|
eshell-prompt-regexp "^λ ")
|
||||||
|
|
||||||
(+dx/create-toggle-function
|
(+dx/create-toggle-function
|
||||||
|
|||||||
Reference in New Issue
Block a user