Julian Krispel-Samsel
Julian Krispel-Samsel

Reputation: 7734

Vim upload on save like netbeans

I've come across proj-vim which uses transmit-vim to upload project files. However, the readme doesn't tell me how to actually do this.

Ideally I'd like to keep the workflow I had with netbeans, where I have a local subset of the project. The files automatically upload to the server when I hit save.

Can I replicate that behaviour in vim, and if so, how?

Upvotes: 1

Views: 289

Answers (1)

ZyX
ZyX

Reputation: 53614

If you know a command for uploading a file it is just as easy as

augroup AutoUpload
    autocmd! BufWritePost * :{TransmitFiles}
augroup END

, better with some stuff that checks whether you actually can transmit something (or :silent! in front of {TransmitFiles} if you are sure that command will just throw error in case nothing can be transmitted and won’t break anything).

Update: Seems that it should look like

augroup AutoUpload
    autocmd! BufWritePost * :silent! call TransmitFtpSendFile()
augroup END

: I do not see a straightforward way to check whether something may be transmitted.

Upvotes: 4

Related Questions