Make eshell alias list easier to work with

This commit is contained in:
Jeremy Dormitzer 2020-07-21 09:42:52 -04:00
parent 2e75c083b3
commit d5651d8edb

View File

@ -2681,15 +2681,21 @@ A function to properly clear the eshell:
Some aliases:
#+BEGIN_SRC emacs-lisp
(defvar eshell-aliases nil
"Aliases loaded when Eshell starts")
(setq eshell-aliases
'(("k" . "kubectl $*")
("kctx" . "kubectx $*")
("root" . "cd (projectile-project-root)")))
'(("root" . "cd (projectile-project-root)")))
(add-hook
'eshell-mode-hook
(lambda ()
(dolist (alias eshell-aliases)
(eshell/alias (car alias) (cdr alias)))))
(defun def-eshell-alias! (alias command)
(add-to-list 'eshell-aliases (cons alias command))
(eshell/alias alias command))
#+END_SRC
** Prompt