diff options
author | Thanos Apollo <[email protected]> | 2023-05-03 09:04:00 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-05-03 09:04:00 +0300 |
commit | 3195ba6529984b4de3a8586cd7312060ac8976d9 (patch) | |
tree | c665b704af4bf77c175795a74cdd00f8983fc0f0 /emacs.org | |
parent | 010c60b145816e3deb1cdf714ce6ff9e3e45a073 (diff) |
emacs: Add eshell-load-bash-aliases
Diffstat (limited to 'emacs.org')
-rwxr-xr-x | emacs.org | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -369,11 +369,23 @@ Hook with ~dired-mode~ :config (defvar eshell-path-env (getenv "~/.local/bin"))) + (defun eshell-load-bash-aliases () + "Read Bash aliases and add them to the list of eshell aliases." + ;; Bash needs to be run - temporarily - interactively + ;; in order to get the list of aliases. + (with-temp-buffer + (call-process "bash" nil '(t nil) nil "-ci" "alias") + (goto-char (point-min)) + (while (re-search-forward "alias \\(.+\\)='\\(.+\\)'$" nil t) + (eshell/alias (match-string 1) (match-string 2))))) + + (defalias 'open 'find-file) + (add-hook 'eshell-alias-load-hook 'eshell-load-bash-aliases) (eshell-git-prompt-use-theme 'powerline) (eshell-syntax-highlighting-global-mode 1) - (defalias 'open 'find-file) + ;; (setq eshell-prompt-function 'apollo-eshell-prompt) (setq eshell-highlight-prompt t) |