ftpsync : Synchronize files with a remote server
script karma |
Rating 44/18,
Downloaded by 2593 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Fabien Bouleau |
|
script type |
utility |
|
description |
The FtpUpdate script provides you the ability to synchronize your files with a server. The main idea when I created this script was to use GVim to edit the files on my local PC, which one has SVN or GIT, rather than directly on the remote server in a shared directory (similar to the staging concept in GIT).
With S-F7, you can define the server and the remote path used. The settings can be set for the buffer only or globally if you have many files to synchronize from/to the same directory. You can set both, and then buffer settings will preempt global settings.
Key mapping:
- <S-F5> and <S-F6>: allow you to update your file respectively from and to the server. Asks for the synchronization parameters if needed.
- <S-F7>: set the synchronization parameters.
- <S-F8>: display the synchronization parameters of the current buffer.
Public functions:
- FtpGetParam(): display the synchronization parameters of the current buffer.
- FtpSetParam(...): set the synchronization parameters
- FtpSetServer(...): set the server parameter
- FtpSetPath(...): set the path parameter
- FtpUpdate(): put the buffer to the remote server
- FtpRefresh(): get the file from the remote server
Note that you can set both global parameters and buffer parameters for a specific buffer which needs different parameters. The buffer settings are taken into account before the global ones.
Further more, through the FtpSetPath or FtpSetServer functions, you can set only a specific path or server for a buffer, the second parameter (path or server) being taken from the global variable.
Example:
With <S-F7> you set global parameters srv1 and path /home/user1. Then for a specific buffer you type :call FtpSetPath() and set /home/dummy2 as buffer path (or type :call FtpSetPath("/home/user2","b")).
Then using <S-F5> or <S-F6> on this buffer will use ftp://srv1/home/user2 and ftp://srv1/home/user1 for the other ones.
The protocol used is FTP. Writing and reading are performed through netrw.vim plugin, i.e. as typing
:write <proto>://<server>/<path>/<file>
or
:read <proto>://<server>/<path>/<file>
Note that <proto> is set in g:FtpSync_Proto (scp by default).
|
|
install details |
Copy the ftpsync.vim file into your $VIM/vimfiles/plugin directory and restart VIM |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 18.188.103.74
|