sudo-edit.el
Open files as another user
This package allows to open files as another user, by default "root":
M-x sudo-edit
Suggested keybinding:
(global-set-key (kbd "C-c C-r") 'sudo-edit)
Installation:
To use this mode, put the following in your init.el:
(require 'sudo-edit)
Customization Documentation
sudo-edit-user
Default user to edit a file with sudo-edit
.
sudo-edit-local-method
Tramp method to use with sudo-edit
for local files.
sudo-edit-remote-method
Tramp method to use with sudo-edit
for remote files.
Function and Macro Documentation
(sudo-edit-set-header)
*Display a warning in header line of the current buffer.
This function is suitable to add to find-file-hook
and dired-file-hook
.
(sudo-edit-tramp-get-parameter VEC PARAM)
Return from tramp VEC a parameter PARAM.
(sudo-edit-out-of-band-ssh-p FILENAME)
Check if tramp FILENAME is a out-of-band method and use ssh.
(sudo-edit-filename FILENAME USER)
Return a tramp edit name for a FILENAME as USER.
(sudo-edit &optional ARG)
Edit currently visited file as another user, by default sudo-edit-user
.
With a prefix ARG prompt for a file to visit. Will also prompt
for a file to visit if current buffer is not visiting a file.
(sudo-edit-find-file FILENAME)
Edit FILENAME as another user, by default sudo-edit-user
.