From c5ff8b40568de54adb081a93d2ac9b3454060ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sat, 26 Oct 2019 19:12:36 -0500 Subject: Added 'sudo open file option' --- modules/init-gui.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules/init-gui.el') diff --git a/modules/init-gui.el b/modules/init-gui.el index e4808b0..0e4a40a 100644 --- a/modules/init-gui.el +++ b/modules/init-gui.el @@ -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 ;;---------------------------------------------------------------------------- -- cgit v1.2.3