eshion / vim-sync

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

Error with newer versions of VIM #1

Closed citosid closed 9 years ago

citosid commented 9 years ago

I have a MacBook Pro with OSX 10.9, and I came to notice your documentation is wrong.

Instead of having the configuration script for sftp

expect -c <<'END_EXPECT'

Actually, there is no needed expect at all...

With this command it will work the same:

#!/bin/sh
case "$1" in
    upload)
        cmd="put $3 /var/www/localhost/htdocs/dev1.site.org/$3"
        ;;
    download)
        cmd="get /var/www/localhost/htdocs/dev1.site.org/$3 $3"
        ;;
esac
echo "$cmd" | sftp -i /Users/myuser/.ssh/private.key root@dev.site.org 

You can refer to: http://bit.ly/YdIzyH

glennj commented 9 years ago

The documentation fix would be: change

expect -c <<'END_EXPECT'

to

expect <<END_EXPECT

in both places. If passphrase-less ssh keys are set up, expect is not required, as there's no password to enter.

gambledor commented 9 years ago

For me it works like this

#!/bin/sh
case "$1" in
    upload)
        cmd="put $3 public_html/$2/"
        ;;
    download)
        cmd="get public_html/$2/$3"
        ;;
esac
echo "$cmd" | sftp -i /Users/myuser/.ssh/private.key root@dev.site.org 
eshion commented 9 years ago

aha, the documentation just an example of how to write .sync file, thanks for your worthwhile suggestion and just do it as you like.