diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -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 () |