Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 - How to cause LiveReload refresh when the currently edited file changes externally

Sublime Text 2 - How to cause LiveReload refresh when the currently edited file changes externally (like Visual Studio)

I installed LiveReload and when I activate it in the browser it can communicate with Sublime Text and reload the current page if the “Save" in Sublime is detected. This works fine if I am working only in Sublime Text editor.

However I also work in Visual Studio on the same set of files. I added Sublime Text as an external process to run from my Tools menu which when run will pass currently edited page and its cursor position to the Sublime Text so when Sublime Text opens that file I can edit the same file and be on the same current line as in Visual Studio (That is a nice feature of Sublime to accept cursor position as input command argument). This works fine too.

What it doesn’t work is I edit a file in Visual Studio that I have opened in Sublime text and and save it, that change is not detected as “Save" action in Sublime and I don’t see LiveReload functionality. I think the file will only be reloaded in Sublime.

Is there a way to treat a change to the currently edited file in Sublime Text from an external program as “Save” operation which in turn will trigger LiveReload in the browser?

I wouldn't want to have 2 reload solution one for sublime and for Visual Studio. I am fine to have 2 editors opened at the same time. Ideally it would be nice to have one LiveReload plugin that would cause refresh from both Visual Studio and Submlime text

Thanks,

Rad

like image 872
Rad Avatar asked Feb 04 '13 22:02

Rad


People also ask

How to refresh file in Sublime Text?

Although there is an accepted answer, it requires that we have to refresh manually everytime by pressing F5.

How do I use sublime LiveReload?

Using the pluginopen any file in your project and right click > open in browser. now in browser Enable LiveReload on that page by clicking the icon on the top right, which looks like a wheel, the livereload sign. and then you can watch your changes as you save them.


1 Answers

I use sublime in linux and it automatically reloads. No need for a plugin. Case may be different in Windows though

like image 112
tr33hous Avatar answered Sep 23 '22 03:09

tr33hous