1

I'm using Vim under GNU/Linux and I use the gnome functionalities to mount FTP / SFTP as drives using GVFS (http://en.wikipedia.org/wiki/GVFS).

When I use Vim to edit files directly on the GVFS folders I have the following problem : file's access rights are altered.

Before :

-rwxrwxrwx

After :w :

-rwx------

When I use Gedit I have not this problem, so I suppose the problem is not directly from GVFS.

Is there something in my .vimrc that I can add to prevent those alterations ?

2 Answers2

1

I had the exact same problem a few months ago, eating up a whole site just by editing 3 files. Thankfully, the problem was easy to fix and I didn't explore the whys and hows and vowed to never use that feature again.

But your question lead me to this thread on launchpad that you may find interesting. In short:

  • The bug is on GVFS's side and has been around since forever without any progress.
  • It happens with other editors/IDEs, too.
  • There's nothing you can do in Vim itself to prevent that bug.
  • Using sshfs instead of GVFS seems to work correctly.
HackToHell
  • 6,408
romainl
  • 23,415
0

Experiment with 'backup', 'backupcopy' and 'writebackup' options. This might have something to do with the way Vim creates backup files – in some modes, it renames the original and creates a new file in its place, possibly causing Gvfs to do the same on the server.

grawity
  • 501,077