I’ll preface this post with a quote from one of our local users, findlay:
11:15 < findlay-w> I can edit google's homepage from within vim?!
11:15 < findlay-w> now that's a powerful editor!
That’s right vim is a powerful editor! Now, of course, you can’t publicly change Google’s homepage with vim but you can edit it directly to be saved elsewhere. Same with any other web-based file or file on a remote machine. Here are some examples:
vim scp://[email protected]/path/to/file (remotely edit a file via scp)
vim ftp://[email protected]/path/to/file remotely edit a file via ftp)
vim scp://[email protected]/path/to/dir (remotely show directory contents with the ability to select and edit a file)
And from within vim, if you’d like to open a remote file or create a remote file.
:e http://google.com/ (remotely see/edit the contents of Google's homepage)
:e http://yourwebsitehere.tld/ (remotely see/edit the contents of your homepage)
:e scp://[email protected]//etc/apt/sources.list (remotely edit the sources.list file on another machine via scp)
:e ftp://[email protected]//pub/somefile (remotely edit somefile on another machine via ftp)
...or the examples above prefixed with :e
I’m sure that is enough to get you in trouble–err, I man, started. Enjoy. For more information on how all of this works and additional options, please see the help for netrw within vim (:help netrw).
And that has been this weeks “Vim Tip of the Week!”