Changes

Jump to navigation Jump to search
458 bytes added ,  05:50, 7 March 2014
edit current file as root
The <tt>plink</tt> method built into TRAMP can be used as a mostly drop-in replacement for SSH connections. It uses <tt>plink.exe</tt> from the [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY suite of tools], which must be installed separately.
 
== Tips and tricks ==
 
=== Edit current file as root ===
 
Use the function below to open the current file as root:
 
<source lang="lisp">
(defun edit-current-file-as-root ()
"Edit the file that is associated with the current buffer as root"
(interactive)
(if (buffer-file-name)
(progn
(setq file (concat "/sudo::" (buffer-file-name)))
(find-file file))
(message "Current buffer does not have an associated file.")))
</source>
[[Category:Remote Edit]]

Navigation menu