Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a middle size PHP application. I'm currently switching from Netbeans to vim (bc it looks gross on Ubuntu). However, the only thing I do miss from Netbeans is a FTP upload after save.

My question is: is there a plugin which automatically uploads on save (or hotkey like ctrl u) in VIM?

share|improve this question

I can not resist the advice to use ssh (scp / sftp) rather then ftp as I think it is more secure.

At any rate, vim will open files or save files over ftp (and scp).


Notice the double // :)

See this tutorial for details.

At any rate, to save a file you are working on locally over ftp, user Nwrite

Nwrite ftp://user@server/path/to/file.php

You can map that in vim with

cmap <Leader>r :Nread ftp://user@server/path/to/file.php
cmap <Leader>w :Nwrite ftp://user@server/path/to/file.php

Leader is a variable, by default it is /, but you can define it as another key

:let mapleader = "+"

For details See:

share|improve this answer
What would be a variable for file.php? I imagine everyone isn't editing only 1 file. – Goddard Aug 24 '15 at 23:13

Take a loot at this

using this you can have a local working copy of a file and when you are editing using vim, you can save the minor changes directly to ftp server using upload command like this:


you can make the change to the upload script given in that link,

But best way would be to use ssh/scp to tranfer the complete file over the ftp.

Also, using a versioning system like SVN or CVS would be better, you can commit the code changes, and those changes will be transferred using ssh. Also a versioning system will give you advanced tools like diff, using which you can compare your code changes to previous version and validate before commiting changes. This would avoid any errors due to typo.

share|improve this answer

The easy way to accomplish that goal does not involve a VIM plugin: simply mount the remote file system instead. In this way, files can be accessed as though they exist locally.

This is done via sshfs, if sshfs is available to you. (There is also an FTP filesystem that could work: ftpfs or 'curlftpfs' if you cannot use the excellent fuse/sshfs.)

Some links for the sshfs option:

Btw, does this NetBeans look gross? (You can get mostly around the problem with Java Swing applications and fonts.) There is also Komodo Edit and Eclipse (Eclipse Helios is good).

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.