From 6c0b430651db9461df577f6ec5750d5e7c778aa0 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Aug 2017 12:35:19 -0400 Subject: [PATCH] Add find-file-as-root command --- .emacs.d/init.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1640630..af507fc 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -90,11 +90,14 @@ (add-to-list 'python-shell-completion-native-disabled-interpreters "ipython"))) (use-package tramp - :defer + :bind ("C-c C-f" . find-file-as-root) :config (add-to-list 'tramp-remote-path 'tramp-own-remote-path) (add-to-list 'tramp-remote-path '"/home/adam/asgoldsmith/install/bin/") - (setq tramp-default-method "ssh")) + (setq tramp-default-method "ssh") + (defun find-file-as-root () + (interactive) + (find-file (concat "/sudo::" (buffer-file-name))))) (use-package comint :config