Edit remote file with vim
March 18, 2009
Posted by on
Editing a file located in a remote machine with vim on my local machine has never cross my mind until now. Today, I need to do some coding in a remote machine that didn’t have vim installed and I don’t have the right to install it there. Vim support what I need:
E.g. vim scp://firstname.lastname@example.org//home/user/help.txt
*Note the double slash after the remote host. Single slash will not work.
The command will:
1. Download the remote file.
2. Start vim to edit it.
3. Upload the file back to remote host every time you save.