10

When mounting /vagrant over NFS, a changed file on the host is not refresh on the guest if the size doesn't changes. Quick update/typo are not immediately reflected unless I make enough modification for the size to be different.

I've tried to set lookupcache=none but apart from making everything slower, nothing change.

I'm using OSX ML as host and Arch Linux as guest. NFS is v3 (because of OSX).

hlidotbe
  • 215
  • 3
  • 6

2 Answers2

28

This was bugging me for months, and I finally found a fix, if you're using Sublime Text (I'm on ST3). Check to see if it's using atomic saves — they were causing this issue for me.

To your Preferences.sublime-settings file, (Sublime Text > Preferences > Settings- User) add this:

{
    "atomic_save": false
}

This fixed the cached file-size NFS issue for us. Still unsure whether the root issue is in the OS X NFS daemon or the Ubuntu client (my money's on OS X).

Andy Fowler
  • 421
  • 5
  • 5
  • I'll accept your answer as we found the same fix but I forgot to edit/answer the question. Thanks – hlidotbe Jan 07 '14 at 21:32
  • This is an important piece of info. One of our developers noticed that changing a digit in code wasn't reflected on his vagrant site (same file size). This is a pretty bad bug. Thanks for sharing this solution. – Bernard Feb 28 '14 at 01:37
  • This worked instantly. You can also add it to just your project config file under "settings" if you don't want to adjust how Sublime saves files in non-vagrant projects. – dcneiner Jun 19 '14 at 14:50
  • I suspect this would have taken me hours, days, weeks, months, or years to track down. Thank you Andy!! – nlh Sep 04 '14 at 19:00
  • 1
    You just saved me like a GAZILLION of cut content/save/refresh/paste/save/refresh... I buy you a beer. – George Katsanos Oct 05 '14 at 11:27
  • Not using sublime text 3, seeing this issue anyway (sublime text 2) – linuxdan Dec 30 '14 at 00:32
  • This was hard to debug @Andy, well done buddy – Mick Sep 07 '15 at 10:47
0

VIM users

@andy has done it all, had the same problem using VIM, simply use:

:set nobackup
Mick
  • 203
  • 2
  • 7