diff options
Diffstat (limited to 'Emacs/.config/emacs')
-rw-r--r-- | Emacs/.config/emacs/elisp/eshell-additions.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Emacs/.config/emacs/elisp/eshell-additions.el b/Emacs/.config/emacs/elisp/eshell-additions.el index b18a8e8..51cdf21 100644 --- a/Emacs/.config/emacs/elisp/eshell-additions.el +++ b/Emacs/.config/emacs/elisp/eshell-additions.el @@ -30,7 +30,11 @@ ;; Aliases (defun eshell/goto (&rest args) "Use `read-directory-name' to change directories" - (eshell/cd (list (read-directory-name "Directory?: ")))) + (let* ((name (read-file-name "Choose file: ")) + (dir (file-name-directory name))) + (eshell/cd (list dir)) + (if (not (file-directory-p name)) + (find-file name)))) (defun eshell/project-root (&rest args) "Change to directory `project-root'" |