Last active
August 29, 2015 14:02
-
-
Save Pitometsu/23e29d33c3a0a8a15e1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; eshell prompt | |
(setq eshell-prompt-function | |
(lambda () | |
(let ((user-uid-face (if (zerop (user-uid)) | |
'((t (:inherit (eshell-ls-missing eshell-prompt bold)))) | |
'((t (:inherit (eshell-ls-directory eshell-prompt bold))))))) | |
(concat | |
(propertize (or (ignore-errors | |
(format "[%s] " | |
(vc-call-backend (vc-responsible-backend default-directory) 'mode-line-string default-directory) | |
;; (symbol-name (vc-responsible-backend default-directory)) | |
)) "") | |
'face '((t (:inherit (eshell-ls-clutter eshell-prompt))))) | |
(propertize (eshell/pwd) | |
'face '((t (:inherit (eshell-prompt))))) | |
(propertize (format-time-string " | %Y-%m-%d %H:%M " (current-time)) | |
'face '((t (:inherit (org-hide eshell-prompt))))) | |
(propertize "\n" | |
'face '((t (:inherit eshell-prompt)))) | |
(propertize user-login-name | |
'face '((t (:inherit (eshell-ls-symlink eshell-prompt))))) | |
(propertize "@" | |
'face user-uid-face) | |
(propertize system-name | |
'face '((t (:inherit (eshell-ls-executable eshell-prompt))))) | |
(if (= (user-uid) 0) | |
(propertize " ■" | |
'face user-uid-face) | |
(propertize " ●" | |
'face user-uid-face)) | |
" ")))) | |
(setq eshell-prompt-regexp "^[^■●\n]* [■●] ") | |
;; problem here: | |
(setq eshell-highlight-prompt nil) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment