summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2014-09-03 12:44:21 +0200
committerrekado <rekado@elephly.net>2014-09-03 12:44:21 +0200
commit928dc209bdbdd621a44f3033a57cceb82b7daa9b (patch)
tree5085a6eccc9de583d3b1c17b8ebc6f3986b2d669 /init.el
parent91484e3d06a6d5ac252694f77dc653c8920848a8 (diff)
eshell: add convenience function to jump to remote root dir
Diffstat (limited to 'init.el')
-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) ":/")
+ "/"))))