Editing di file remoti con vim e scp

From RVM Wiki
Revision as of 16:36, 3 May 2006 by Gabriele.vivinetto (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Da VIM Tip #337: editing remote files via scp in vim:

VIM 6.x has the netrw plugin installed as a standard plugin.

It allows you to edit files via ftp, rcp, scp, or http.

If your username differs on the remote host, however, and you're trying to use scp, things can get a little wierd, particularly if you're not editing a document under your user tree.

To get around this, try opening the file as follows:

vim scp://remoteuser@server.tld//path/to/document

Notice two things: adding the "remoteuser@" syntax, and the use of two slashes (//) between the servername and the path.

The first sets the remote user so that scp will not grab the $USERNAME environment variable, the second will appropriately set the absolute path.