Sublime Text 2 keyboard shortcut to open file in specified browser (e.g. Chrome)

后端 未结 14 2215
野性不改
野性不改 2020-12-02 04:31

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 set

14条回答
  •  忘掉有多难
    2020-12-02 04:55

    This worked on Sublime 3:


    To browse html files with default app by Alt+L hotkey:

    Add this line to Preferences -> Key Bindings - User opening file:

    { "keys": ["alt+l"], "command": "open_in_browser"}
    


    To browse or open with external app like chrome:

    Add this line to Tools -> Build System -> New Build System... opening file, and save with name "OpenWithChrome.sublime-build"

    "shell_cmd": "C:\\PROGRA~1\\Google\\Chrome\\APPLIC~1\\chrome.exe $file"
    

    Then you can browse/open the file by selecting Tools -> Build System -> OpenWithChrome and pressing F7 or Ctrl+B key.

提交回复
热议问题