Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@juergenhoetzel
Created May 11, 2011 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juergenhoetzel/966608 to your computer and use it in GitHub Desktop.
Save juergenhoetzel/966608 to your computer and use it in GitHub Desktop.
Reopen file visited in current buffer using tramp-sudo
(defun reopen-sudo ()
(interactive)
(unless (file-remote-p (buffer-file-name))
(find-file (tramp-make-tramp-file-name "sudo" "root" "localhost" (buffer-file-name)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment