Fancier eshell prompt + fix yasnippet loading

This commit is contained in:
Jeremy Dormitzer 2021-01-11 15:18:57 -05:00
parent c4e6104c64
commit f019c1153e

View File

@ -2640,12 +2640,14 @@ A function to properly clear the eshell:
#+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) " # " " $ ")))))
(format "%s%s"
(if branch (format "(%s) " branch) "")
(concat (abbreviate-file-name (eshell/pwd))
(propertize
(if (= (user-uid) 0) " # " " λ ")
'face `(:foreground "#859900"))))))
(setq jdormit-eshell-prompt-regex "^[^#$\n]* [#$] ")
(setq jdormit-eshell-prompt-regex "^[^#λ\n]* [#λ] ")
(setq eshell-prompt-function 'jdormit-eshell-prompt)
(setq eshell-prompt-regexp jdormit-eshell-prompt-regex)
@ -4883,7 +4885,8 @@ YASnippet is Yet Another Snippet template system.
#+BEGIN_SRC emacs-lisp
(use-package yasnippet
:hook ((text-mode . yas-minor-mode)
(prog-mode . yas-minor-mode))
(prog-mode . yas-minor-mode)
(after-init . yas-reload-all))
:config
(unless (file-exists-p (expand-file-name "~/.emacs.d/snippets"))
(mkdir (expand-file-name "~/.emacs.d/snippets") t))