Sync files with remote machine in vim
Use your plugin manager of choice.
- Pathogen
git clone https://github.com/yifeikong/vim-sync ~/.vim/bundle/vim-sync
- Vundle
- Add
Bundle 'https://github.com/yifeikong/vim-sync'
to .vimrc - Run
:BundleInstall
- Add
- NeoBundle
- Add
NeoBundle 'https://github.com/yifeikong/vim-sync'
to .vimrc - Run
:NeoBundleInstall
- Add
- vim-plug
- Add
Plug 'https://github.com/yifeikong/vim-sync'
to .vimrc - Run
:PlugInstall
- Add
When you have a slow network, editing files on remote machine can be very annoying. With vim-sync, you can edit files on local machine and upload it right in vim.
Vim-sync uses rsync to sync between your local project files with remote ones. Suppose your remote repository is /opt/my-project, remote machine is john@example.com and your local repository is ~/repos/my-project.
-
create a file named
.vim-sync
in project root on local machine, with remote address as content% cd ~/repos/my-project % echo 'john@example.com:/opt/my-project' > .vim-sync
-
Edit some files and save them.
-
Use
:VSUploadFile
to upload current file to remote, use:VSUpload
to upload all files to remote.
- support asyncrun.
- better error handling
- add doc in vim