From 072531e96ecbdf418799ce26e093f1278da64416 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 4 Oct 2023 15:08:46 +0300 Subject: emacas: (shells) update shell aliases --- .emacs.d/modules/thanos-shells.el | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to '.emacs.d/modules') diff --git a/.emacs.d/modules/thanos-shells.el b/.emacs.d/modules/thanos-shells.el index c421f48..2242733 100644 --- a/.emacs.d/modules/thanos-shells.el +++ b/.emacs.d/modules/thanos-shells.el @@ -102,20 +102,25 @@ "Completion rules for `hut' command" (pcomplete-here (append pcomplete-hut-commands))) -(setq thanos/eshell-aliases - '((g . magit) - (gl . magit-log) - (gc . magit-clone) - (d . dired) - (o . find-file) - (oo . find-file-other-window) - (ll . (lambda () (eshell/ls '-lha))) - (eshell/clear . eshell/clear-scrollback))) - -;; Define aliases using `mapc` -(mapc (lambda (alias) - (defalias (car alias) (cdr alias))) - thanos/eshell-aliases) + +;; Setting eshell aliases +(defvar thanos/aliases + '((g . magit) + (gl . magit-log) + (gc . magit-clone) + (d . dired) + (o . find-file) + (oo . find-file-other-window) + (ll . (lambda () (eshell/ls '-lha))) + (eshell/clear . eshell/clear-scrollback))) + +(defun thanos/set-eshell-aliases (aliases) + "Set ALIASES as eshell aliases." + (mapc (lambda (alias) + (defalias (car alias) (cdr alias))) + aliases)) + +(add-hook 'eshell-mode-hook #'(lambda () (thanos/set-eshell-aliases thanos/aliases))) ;; PATH (defvar eshell-path-env (getenv "~/.local/bin")) -- cgit v1.2.3