Created
September 21, 2017 21:33
-
-
Save sw1nn/765afb8a947bb95fddce181696aafb7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defadvice ido-find-file (after find-file-sudo activate) | |
"Find file as root if necessary." | |
(unless (and buffer-file-name | |
(file-writable-p buffer-file-name)) | |
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment