From 6067f1028fc90e8341d82669574f3610f679f544 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 10 Dec 2025 13:37:43 +0100 Subject: [PATCH] bba-eshell-host * bba-shell.org: insert the current remote host as a root directory. --- bba-shell.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bba-shell.org b/bba-shell.org index 9a253d6e..956eaea4 100644 --- a/bba-shell.org +++ b/bba-shell.org @@ -123,6 +123,23 @@ A little bit of code from https://github.com/bodil/emacs.d/blob/master/bodil/bod (eshell/cd (format "%s%s" host new-path)))) #+end_src +Better than a specific cd command we can insert the current remote +host. + +#+begin_src elisp + (defun bba-eshell-host() + (interactive) + (let* ((d default-directory) + (s (split-string d ":")) + (path (car (last s))) + (l (length path)) + (host (substring d 0 (- (length d) l)))) + (insert host))) + + (define-key eshell-mode-map (kbd "s-i") 'bba-eshell-host) +#+end_src + + ** [[https://codeberg.org/akib/emacs-eat/][eat]] [2024-02-05 Mon 12:10] -- 2.47.3