eshion / vim-sync

Automatic sync SFTP,FTP,... for buffers in vim
67 stars 22 forks source link

vim-sync

Automatic sync local and remote file in vim

Installation

Install using bundle,vundle,pathogen or your favorite Vim package manager.

Requires

Asyncrun to upload asynchronously.

Usage

create a execute file called .sync in your project directory. e.g. /project_dir/ is your project dirctory and the execute file is /project_dir/.sync. how to write execute file see "some execute config" section.

<leader>su
Upload current buffer file, it will execute the command: project_dir/.sync upload current_buffer_fold current_file_name

<leader>sd
Download current buffer file, it will execute the command: project_dir/.sync download current_buffer_fold current_file_name

some execute config

Configuration

Defines the filenames of the executable file to use to synchronize your sources.

This file will be searched from the directory of the file to synchronized. For example, when editing a symlink and g:sync_push_symlink_too is enabled the target will first be synchronized and the file will be searched from the target directory. Then the symlink will be synchronized and the file will be searched from the symlink directory.

You can prodive multiple filenames, separate with a ",".

To look backward in the directory tree add ";" at the end of the filname.

Example :

let g:sync_exe_filenames = '.sync;' " Looks backward for a file named ".sync"

let g:sync_exe_filenames = '.sync;,.sync.sh; " Looks backward for a file named ".sync". If not found then looks backward for a file named ".sync.sh"'

When editing a symlink, allows to synchronized the symlink itself. If disabled, only the target is synchronized.

Might be usefull is you use a lot of symlinks and don't want to have to push them manually to the remote.

Defines if the upload should be asynchronous. Requires the [Asyncryn] plugin.

Alias

If you want to another command, write following like.

Ctrl+u nnoremap <C-U> <ESC>:call SyncUploadFile()<CR>

Ctrl+d nnoremap <C-D> <ESC>:call SyncDownloadFile()<CR>