From 36ee9d938596fe4a274e81efc722c8b420832480 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sat, 27 Jul 2024 04:37:12 +0100 Subject: (Emacs/config)+eshell/sudo-switch function --- Emacs/.config/emacs/elisp/eshell-additions.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Emacs/.config/emacs/elisp/eshell-additions.el') diff --git a/Emacs/.config/emacs/elisp/eshell-additions.el b/Emacs/.config/emacs/elisp/eshell-additions.el index 931b89b..6c1147e 100644 --- a/Emacs/.config/emacs/elisp/eshell-additions.el +++ b/Emacs/.config/emacs/elisp/eshell-additions.el @@ -41,6 +41,11 @@ (eshell/echo (format "[%s]: No project in current directory" error-msg))))) +(defun eshell/sudo-switch (&rest args) + "Switch to a tramp connection sudo in the current directory" + (let ((wrapped-dir (concat "/sudo::" default-directory))) + (eshell/cd wrapped-dir))) + ;; Additional functions (defun +eshell/at-cwd () "Open an instance of eshell at the current working directory." -- cgit v1.2.3-13-gbd6f