Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 952 Bytes

edit-over-ssh-with-vim.md

File metadata and controls

43 lines (35 loc) · 952 Bytes
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
edit-over-ssh-with-vim
vim
public
2020-06-19 03:05:44 -0700
2020-06-19 03:05:44 -0700
false
20200619100544
false
false
vim
remote
scp
Edit over SSH with Vim
tech-note

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.