Make eshell alias list easier to work with
This commit is contained in:
parent
2e75c083b3
commit
d5651d8edb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user