top image
home  /  pages  /  tech tips  /  contact about

Speeding up Vim's Netrw plugin over ssh/scp


You edit files over ssh/scp by using Vim's Netrw plugin, but writing the file is still slow.

A related article discusses filename completion with Vim's Netrw plugin.


Vim, Netrw, ssh, sshfs, scp, ControlMaster, ControlPath.


Use ssh's ControlMaster and ControlPath (see the ssh_config man page) to share multiple ssh connections over a single network connection. That cuts out the cryptographic handshake on each file write, sometimes speeding it up by an order of magnitude.

Add to your ~/.ssh/config

# you change "*" to the hostname you care about
Host *
  ControlMaster auto
  ControlPath /tmp/%r@%h:%p

Then create an ssh connection to the host and leave it running.

ssh -N

Now open a file remotely with Vim's Netrw and enjoy the zippiness.

vim scp://

Copyright © 1994-2022 by Thomer M. Gil
Updated: 2011/04/04