From 55862a521696b9e36b43d719587a9f266b21749b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 16 Apr 2024 21:58:44 +0630 Subject: (Emacs/app)+eshell command that goes to `projectile-project-root` if it exists --- Emacs/.config/emacs/app.org | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Emacs/.config/emacs') diff --git a/Emacs/.config/emacs/app.org b/Emacs/.config/emacs/app.org index ce47e23..8fcecbb 100644 --- a/Emacs/.config/emacs/app.org +++ b/Emacs/.config/emacs/app.org @@ -520,7 +520,14 @@ much faster than ~cd ..; ls -l~). (defun eshell/goto (&rest args) "Use `read-directory-name' to change directories." - (eshell/cd (list (read-directory-name "Enter directory to go to:"))))) + (eshell/cd (list (read-directory-name "Enter directory to go to:")))) + + (with-eval-after-load "projectile" + (defun eshell/goto-project-root (&rest args) + "Change to directory `projectile-project-root'" + (if (projectile-project-root) + (eshell/cd (list (projectile-project-root))) + (eshell/echo "Projectile not active here..."))))) #+end_src ** Eshell change directory quickly ~eshell/goto~ is a better ~cd~ for eshell. However it is really just -- cgit v1.2.3-13-gbd6f