4 ms·
Sublime Text Plugin: Activate & reload Chrome with a keyboard shorcut
- sgricci 15y agoI just use LiveReload for this.
- mutewinter 15y agoYes. A thousand times yes. I used to have a vim plugin[1] for reloading Chrome also. LiveReload[2] is far and away the way to go. [1]: https://github.com/mkitt/browser-refresh.vim https://github.com/mkitt/browser-refresh.vim [2]: http://livereload.com/ http://livereload.com/
- yolk 15y agoI am so happy. Thank you for these.
- rev087 15y agoAnother great tool for Mac: http://incident57.com/codekit/ http://incident57.com/codekit/
- kuroir 15y agoCodeKit is "ok". But I prefer 100 times to use the command line for this kind of things. Also LiveReload allows you to run it on another sevrer.
- latchkey 15y agoWith LR, I actually had to un-train myself from constantly reloading the browser window. Now I just save a file in my IDE, and LR does it for me. I couldn't imagine going back to anything else.
- rimantas 15y agoAnd in case of CSS LR does not even reload the page, it injects CSS. Very handy for styling some "in between" elements—popovers and stuff like that.
- willy1234x1 15y agoHave you or anyone else had luck with LiveReload and Windows? My main gripe with LiveReload is the requirement of Ruby, I don't code in Ruby so it seems a little unnecessary for me to install it just for reloading a page.
- runjake 15y agoOnly works on Mac OS X in its current form, as it uses embedded AppleScript.
- brickattack 15y agoI normally use Livereload, but this inspired me to whip up this Alfred (http://alfredapp.com http://alfredapp.com) extension - https://github.com/brickattack/Chrome_Reload.alfredextension https://github.com/brickattack/Chrome_Reload.alfredextension If you map it to a global hotkey, you're not limited to using it in any one program.
- wmeddie 15y agoIt's a little known fact that you can easily make these kind of keyboard shortcuts globally by making a Service. Here's how to make a global service that reloads the browser: 1. Open Automator 2. Select Service 3. Search for run Applescript 4. Copy and paste one of the following Applescripts 5. Change the Service receives selected drop down list to "No input" 6. Save the service (Automator will ask you what to name it) You can then find the service under "Services" inside the Application's Menu. You can also assign it to a global shortcut by: 1. Open the Keyboard section in System Preferences 2. Find your service under the Services list 3. Click the service to reveal the Add Shortcut button 4. Type the shortcut (Like Command+Ctrl+R) Applescript for Safari: on run tell application "Safari" do JavaScript "window.location.reload()" in current tab of window 1 activate end tell end run Applescript for Chrome: on run tell application "Google Chrome" to tell the active tab of its first window reload end tell tell application "Google Chrome" to activate end run
- antris 15y agoCan anyone explain why these scripts that do the exact same thing for different browsers are so different? How could one learn to write these things?
- skeletonjelly 15y agoCan the OP edit the title to say "for Mac OSX" please? What a rollercoaster of emotions you put me through
- edanm 15y agoFor anyone who wants to make this in Windows, just script it with AutoHotKey. I have shortcut keys that send me to all of my most-used programs. For example, winkey+y moves me to chrome (if there are many open, it will cycle through them). winkey+s to Sublime Text, winkey+t to Total Commander, winkey+b to vim. They're incredibly easy to write, and adding a refresh into it is child's play (just add a ctrl+r after moving to the window in the script).
- TeMPOraL 15y agoTo see the power of AutoHotkey, look at this: http://www.autohotkey.net/~joten/bug.n.html http://www.autohotkey.net/~joten/bug.n.html A guy made DWM (a keyboard-operated tiling window manager[1]) for Windows using AutoHotkey scripts. And I have to tell, after testing it for some time, it is amazing (and tiling WMs are amazing in general). [1] - http://en.wikipedia.org/wiki/Tiling_window_manager http://en.wikipedia.org/wiki/Tiling_window_manager
- flhke 15y agoI've created an AutoHotKey script last month about that : http://pastebin.com/uXF5B5yy http://pastebin.com/uXF5B5yy
- swah 15y agoThanks, this worked for now!
- bradleyboy 15y agoForked this so that it saves the current view (if unsaved) before reloading: https://github.com/bradleyboy/BrowserRefresh-Sublime https://github.com/bradleyboy/BrowserRefresh-Sublime