Way to use vim work on a cache of a file instead of the actual file?

buffer, vim

Solution

You can edit from ssh directly in vim like this:

:e scp://remoteuser@server.tld//path/to/document

You can find more information in this serverfault question.

Problem

I typically ssh to another computer to do my development, using vim (don't post "Use Emacs" please). However, I notice that vim is very slow when my internet is slow (duh). EDIT: I use a terminal on my local machine and open the remote file with a vim scp://host/file command. However, when I do this, every keystroke that I put in causes vim to go to the network, dramatically slowing things down. Instead, I want vim to read the remote file, let me do my local editing, and only go to the network when I do a :w command. Think of it like a write-back cache option. I know Komodo Edit offers this functionality, which is where I got the idea from.

Original source