Vim Tips - Edit Remote Files With Vim On Linux
Edit remote files with Vim on Linux
$ vim scp://sk@192.168.225.22/info.txt
user@remotesystem:port(E.g.sk@192.168.225.22)Single slash (
/) - If you want to edit a file that is stored in the $HOME directory of a remote system, you must use a trailing slash to separate remote system’s IP address or hostname from the file path.Double slashes (
//) - To specify full path of a file, you must use double slashes. For example, let us say you are editing a file named info.txt that is located in /home/sk/Documents/ directory of your remote system. In this case, the command would be:vim scp://sk@192.168.225.22//home/sk/Documents/info.txtIf you don’t have ssh/scp access, you can use other protocols, for example
ftp.vim ftp://user@remotesystem/path/to/file
Edit remote files within Vim session
:e scp://sk@192.168.225.22/info.txt
