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 [ 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"
(if (buffer-file-name)
(setq file (concat "/sudo::" (buffer-file-name)))
(find-file file))
(message "Current buffer does not have an associated file.")))
[[Category:Remote Edit]]

Navigation menu