0

I'm using gulp + browser sync + vim stack on CentOS 6.5 Server.

In my gulpfile.js watching html difference.

When I changed index.html file and send vim command [wq] browser auto refreshed perfectly.

but When I send command just [w], file saved but browsersync web server can't detect file changed.. so browser doesn't refresh.

Should I always send [wq] command to refresh browser??

Shaffron
  • 97
  • 1
  • 3
  • 11
  • What does your browser sync config look like? I think that it's maybe watching the directory rather than the files contained within it and, if this is the case, it refreshes on a :wq rather than a :w as a swap file is being removed from the directory triggering a change. – Ben Davies Dec 19 '16 at 00:52
  • Oh I missed that point. maybe it cause this situation. thanks to your hint Ben Davies! – Shaffron Dec 19 '16 at 02:20
  • Also note that by Vim makes a copy of the file and overwrites the original one, which can cause problems in some of the file-watching programs (see [this](http://vi.stackexchange.com/a/138/51)). No idea if this is the case in your gulp/browser sync stuff as I've never used it, but you could try setting the `backup` option to `yes` and see if that helps. – Martin Tournoij Dec 20 '16 at 00:38

0 Answers0