Tip #337: editing remote files via scp in vim
tip karma |
Rating 312/107, Viewed by 4741
|
created: |
|
October 3, 2002 12:56 |
|
complexity: |
|
intermediate |
author: |
|
Matthew Weier O'Phinney |
|
as of Vim: |
|
6.0 |
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://[email protected]//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.
<<type the line number and press enter to get there |
vim + cscope + cygwin >>
Additional Notes
|