Added 'sudo open file option'

This commit is contained in:
Jesús 2019-10-26 19:12:36 -05:00
parent f3d6ca2ac1
commit c5ff8b4056
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -84,6 +84,15 @@
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "iceweasel-uxp")
;;----------------------------------------------------------------------------
;; sudo open file option
;;----------------------------------------------------------------------------
(defun sudo-find-file (file-name)
"Like find file, but opens the file as root."
(interactive "FSudo Find File: ")
(let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name))))
(find-file tramp-file-name)))
;;----------------------------------------------------------------------------
;; clock
;;----------------------------------------------------------------------------