Vim can edit files remotely, on a server. It uses scp
to copy it locally, allow you to work on it, and then it copies it back to the server. You can even use netrw
to view remote directories, and then select a file to edit.
Firstly you need to add a host to your ssh config
file:
Host <name>
HostName <ip>
User <username>
IdentityFile <ssh-key>
Then you can simply edit as below:
# Directory:
vim scp://<name>//home/<username>/
# File:
vim scp://<name>//home/<username>/<file>.py
If you have an issue with the statusbar not displaying properly you can just refresh the screen with ^L
.