aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-16 21:58:44 +0630
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-16 21:59:29 +0630
commit55862a521696b9e36b43d719587a9f266b21749b (patch)
treeda34d9e0587f638e714bc7e1fc5266505c328f1f /Emacs/.config
parente07c2c145722c3fd29d2eec6e5c665b1f3ac8acd (diff)
downloaddotfiles-55862a521696b9e36b43d719587a9f266b21749b.tar.gz
dotfiles-55862a521696b9e36b43d719587a9f266b21749b.tar.bz2
dotfiles-55862a521696b9e36b43d719587a9f266b21749b.zip
(Emacs/app)+eshell command that goes to `projectile-project-root` if it exists
Diffstat (limited to 'Emacs/.config')
-rw-r--r--Emacs/.config/emacs/app.org9
1 files changed, 8 insertions, 1 deletions
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