Super User is a question and answer site for computer enthusiasts and power users. 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 loved Gnome's Nautilus and FTP integration and being able to mount a remote FTP directory as a regular bookmark/directory, and double clicking any remote files to open in any unmodified program. I also loved editing text files with GVim.

However, if I double clicked file on Nautilus to open a text file in Gvim, then saving a file will take about 10 seconds and GVim will hang for that amount of time. The major irritant is that I cannot continue editing while the text editor is waiting for the write to finish, this delay interrupted my workflow and thought process and saving becomes a painful process. The other problem is that I don't think simply uploading a file should take that much time.

I'm aware of GVim's internal FTP support, but they are not as well integrated with Nautilus's FTP and it suffers from the same problem.

So a few question:

  1. Is there a way to make GVim or GVFS to save in background while I continue editing?
  2. Why is GVFS so slow? Is there any way to set GVFS to use a single persistent FTP connection instead of creating a new FTP connection each time?

I'm on Gentoo Linux x86-64.

share|improve this question
I have the same issue (at least, it seems like the same issue) on Ubuntu with Kate and SFTP. – user55325 May 8 '11 at 15:29

Unfortunately I don't think you are going to find a solution to this, at least not easily. My understanding is that it is a function of the virtual filesystem - It blocks on writes until they have completed successfully or failed so that can be accurately reported to the application.

I have (like user55325) experienced this with Kate and SFTP, also with a number of other apps, it just seems to be the way it works.

Given that my VPN to work is quite slow I've had to give up editing files this way when working from home and I've had to resort to rsync for large projects.

share|improve this answer

One assumes you've already discounted the netrw plugin that (at least on Debian and Ubuntu) is distributed with the Vim runtime. This would seem to be the right way to do things, unless you need the file to look like it's local for some reason.

If you want to treat a remote file as local, you may be better off with a more-configurable VFS system than gvfs. For example, you might consider the curlftpfs or avfs FUSE modules. The former definitely allows for reconnecting when a connection times out, and is fairly well documented.

It really sounds like your issue is because gVim thinks your file is local when it isn't, and does the correct thing when I/O is blocked waiting for an FTP connection to open. Using a FUSE mount that maintains a persistent connection, or using the netrw plugin properly, should address those issues for you.

You want an application to block on failed writes. Soft-mounting should only be used for read-only data, so even if Vim offered such a behavior, it would not be a good idea to rely on it.

share|improve this answer
As I've written: I'm aware of GVim's internal FTP support, but they are not as well integrated as Nautilus's FTP and **it suffers from the same problem**. Also, I don't think it's true that blocking while writing is always desirable; for example Coda for Mac OSX allows you to continue editing the file while the file is uploaded in the background; there is a spinner that notifies you that the saving is still in progress so you know when to check the result (for my use case of editing a PHP file, I need to check the result on the browser). – Lie Ryan Apr 20 '12 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .