Convert bash aliases into eshell ones.
- Download and copy
load-bash-alias.el
into~/.emacs.d/lisp
directory. - Add the following elisp code to your Emacs config:
;; Tell Emacs where is your personal elisp lib directory
(add-to-list 'load-path "~/.emacs.d/lisp/")
;; load-bash-alias
;; https://github.com/daviderestivo/load-bash-alias
(load-library "load-bash-alias")
- Call load-bash-alias-load-bash-alias-into-eshell interactive function to convert bash aliases into eshell ones:
M-x load-bash-alias-load-bash-alias-into-eshell
Add the following elisp snippet to your init.el:
(use-package load-bash-alias
:ensure t
:config
(setq load-bash-alias-bashrc-file "~/.bashrc")
(setq load-bash-alias-exclude-aliases-regexp "^alias magit\\|^alias oc"))
The location of your barshrc file can be customized by setting the
value of load-bash-alias-bashrc-file
variable:
(setq load-bash-alias-bashrc-file "~/.bashrc")
In case you want to add more alias files please add them to bash-alias-additional-aliases-files
. For example:
(setq load-bash-alias-additional-aliases-files '("~/.dotfiles/bashrc_addons"))
In addition it's possible to exclude certain bash aliases to be converted into eshell ones simply setting load-bash-alias-exclude-aliases-regexp
:
(setq load-bash-alias-exclude-aliases-regexp "^alias magit\\|^alias oc")
The original ideas for this package has been taken from Skye. The original elisp code can be found here.