diff --git a/emacs/init.org b/emacs/init.org index 8b7a4ca..e5e85a1 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -279,7 +279,7 @@ A framework for creating Magit-style popups: Magit is objectively the best Git interface. #+BEGIN_SRC emacs-lisp (use-package magit - :commands (magit-status magit-blame magit-find-file)) + :commands (magit-status magit-blame magit-find-file magit-name-local-branch)) #+END_SRC #+BEGIN_SRC emacs-lisp @@ -1964,6 +1964,21 @@ Some aliases: (eshell/alias (car alias) (cdr alias))))) #+END_SRC +** Prompt +#+BEGIN_SRC emacs-lisp + (defun jdormit-eshell-prompt () + (let ((branch (magit-name-local-branch "HEAD"))) + (format "%s%s" + (if branch (format "(%s) " branch) "") + (concat (abbreviate-file-name (eshell/pwd)) + (if (= (user-uid) 0) " # " " $ "))))) + + (setq jdormit-eshell-prompt-regex "^[^#$\n]* [#$] ") + + (setq eshell-prompt-function 'jdormit-eshell-prompt) + (setq eshell-prompt-regexp jdormit-eshell-prompt-regex) +#+END_SRC + * Flycheck Syntax checking etc.: #+BEGIN_SRC emacs-lisp