summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.el b/init.el
index 8c222c5..bda128c 100644
--- a/init.el
+++ b/init.el
@@ -297,3 +297,12 @@
(find-file file)
(goto-line line))
(find-file (pop args)))))
+
+;; convenience function to go to the remote root when in a directory
+;; on a remote host
+(defun eshell/// ()
+ "Go to the root directory on the remote host."
+ (let ((pieces (split-string (eshell/pwd) ":/")))
+ (eshell/cd (if (> (length pieces) 1)
+ (concat (car pieces) ":/")
+ "/"))))