Better tab completion for scp file names

As a lot of you may know, zsh offers tab completion for scp: filenames.
Normally it would connect and then list the files. As you can imagine this isn’t really that efficient.
The solution is quite simple… By adding

Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p

to the top of your .ssh/config all your connection will automatically create a master connection. As such all subsequent connections will pass through the master. Who’d know it makes scp like browsing a local filesystem. Combined with vim’s netrw I’d say that’s pretty neat.

blog comments powered by Disqus
 Scroll to top