(Emacs/config)+eshell/sudo-switch function
This commit is contained in:
@@ -6,3 +6,4 @@ alias clear clear-scrollback
|
|||||||
alias d dired-other-window $1
|
alias d dired-other-window $1
|
||||||
alias gt goto
|
alias gt goto
|
||||||
alias pr project-root
|
alias pr project-root
|
||||||
|
alias ss sudo-switch
|
||||||
@@ -41,6 +41,11 @@
|
|||||||
(eshell/echo
|
(eshell/echo
|
||||||
(format "[%s]: No project in current directory" error-msg)))))
|
(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
|
;; Additional functions
|
||||||
(defun +eshell/at-cwd ()
|
(defun +eshell/at-cwd ()
|
||||||
"Open an instance of eshell at the current working directory."
|
"Open an instance of eshell at the current working directory."
|
||||||
|
|||||||
Reference in New Issue
Block a user