Edit a remote file with
vim scp://remote/file
Saving the file with :w
blocks the editor till the file changes are saved to the remote.
I was trying to use :Dispatch :write
to avoid being blocked but that does not work (using tmux or iterm strategy). :Dispatch
is provided by the plugin vim-dispatch.
Relevant internet search results suggest:
- Ssh to remote and work there (if you have a slow connection, check this question or consider ssh-alternative mosh)
- eshion/vim-sync offers the possibility to autosync changes of a local file to the remote
- Git hook auto-push: after each commit push changes to the remote
- satiani/async-scp-vim (see for details blog) launch SCP calls whenever the BufWritePost event is triggered
- Ssh tunnel faster write due to open ssh connection (see also Speeding up Vim's Netrw plugin over ssh/scp and autossh).
- sshfs/osxfuse-sshfs
set directory=~/.vim/swaps//; set backupdir=~/.vim/backups
- Neovim no release yet and nightly build does not do it out of the box. Any answer here appreciated. It has been reported as an issue #1464
- Backchannel Vi
The solutions are helpful but require setup of vcs, config files, etc.
I'd prefer
- to work locally
- no configuration for each file (configuring the editor once and for all is ok)
- Not every write should be a commit.
Keeping an ssh tunnel open didn't improve it either.
Update I'd like to know whether there is a solution to run the save process asynchronously. The save process means here, as netrw is showing in the commandline, a scp call to copy the temp file to the remote which can take some time. I'd like to return to my editing in the meanwhile and don't be blocked. I hope this makes my question clearer.
Alternatives to tpope/dispatch are: Shougo/vimproc, idbrii/AsyncCommand, which I haven't tried yet.
Job control (work with processes asynchronously)
). They are investing a significant amount of time in this. – Tellurate:make
and there could be something also for:write
. – Tellurate