summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/init.el b/init.el
index 2626cda..2b8d85c 100644
--- a/init.el
+++ b/init.el
@@ -305,14 +305,19 @@
(goto-line line))
(find-file (pop args)))))
-;; convenience function to go to the remote root when in a directory
+;; convenience function to input 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) ":/")
- "/"))))
+(defun rekado-tramp-root ()
+ "Print root directory on the remote host."
+ (interactive)
+ (let ((pieces (split-string (eshell/pwd) ":/")))
+ (insert-string (if (> (length pieces) 1)
+ (concat (car pieces) ":/")
+ "/"))))
+
+(add-hook 'eshell-mode-hook
+ '(lambda () (define-key eshell-mode-map (kbd "C-c /") 'rekado-tramp-root)))
+
;; start a hidden eshell on startup
(add-hook 'emacs-startup-hook #'(lambda ()