]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
eshell remote cd
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 25 Nov 2025 18:30:10 +0000 (19:30 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 25 Nov 2025 18:30:10 +0000 (19:30 +0100)
* bba-shell.org: cd- to cd / on remote hosts easily.

bba-shell.org

index e69f00984d33280851d5cc91275a76938c755273..9a253d6e5d4db75d39727e2601834270dcfa8ecc 100644 (file)
@@ -113,6 +113,16 @@ A little bit of code from https://github.com/bodil/emacs.d/blob/master/bodil/bod
                     (shell-command "git stash pop")))
 #+end_src
 
+#+begin_src elisp
+  (defun eshell/cd- (new-path)
+  (let* ((d default-directory)
+  (s (split-string d ":"))
+  (path (car (last s)))
+  (l (length path))
+  (host (substring d 0 (- (length d) l))))
+  (eshell/cd (format "%s%s" host new-path))))
+#+end_src
+
 ** [[https://codeberg.org/akib/emacs-eat/][eat]]
 [2024-02-05 Mon 12:10]