I do web development and am trying out Sublime Text 2. Is there a keyboard shortcut to open the current file in specified browser (e.g. Chrome)?
Any help to get setup in Sublime Text for web development is appreciated!
So, if you want to make Ctrl+Alt+C your shortcut key for launching Google Chrome, just press “C”.
Ctrl + D in SublimeText is "Quick Add Next." This appears to be equivalent to Ctrl + B in Brackets, which is "Add next match to Selection" on the Find menu.
I'm not really sure this question is approprate here, but you can add a new "Build System" under Tools -> Build System -> New Build System...
As with all configuration in Sublime Text its just JSON, so it should be pretty straight forward. The main thing you are going to want to configure is the "cmd"
key/val. Here is the build config for launching chrome on my mac.
{ "cmd": ["open", "-a", "Google Chrome", "$file"] }
Save that as Chrome.sublime-build
, relaunch Sublime Text and you should see a new Chrome
option in the build list. Select it, and then you should be able to launch Chrome with Cmd+B on a Mac (or whatever hotkey you have configured for build, maybe its F7 or Ctrl+B on a Windows machine)
At least this should give you a push in the right direction.
Edit:
Another thing I end up doing a lot in Sublime Text 2 is if you right click inside a document, one of the items in the context menu is Copy File Path
, which puts the current file's full path into the clipboard for easy pasting into whatever browser you want.
Sublime Text 3 (linux example) "shell_cmd": "google-chrome '$file'"
"Open in Browser context menu for HTML files" has been added in the latest build (2207). Its release date was 25 June 2012.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With