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

后端 未结 14 2151
野性不改
野性不改 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:34

    You can install SideBarEnhancements plugin, which among other things will give you ability to open file in browser just by clicking F12.

    To open exactly in Chrome, you will need to fix up “Side Bar.sublime-settings” file and set "default_browser" to be "chrome".

    I also recommend to learn this video tutorial on Sublime Text 2.

    0 讨论(0)
  • 2020-12-02 04:36

    Tools -> Build System -> New Build System. The type following as your OS, save as Chrome.sublime-build

    Windows OS

      {
            "cmd": ["C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "$file"]
      }
    

    MAC Os

    {
       "cmd": ["open", "-a", "/Applications/Google Chrome.app", "$file"]
    }
    

    Save the file - Chrome.sublime-build in location

    C:\Users\xnivirro\Downloads\Software-Installed\Sublime-2\Data\Packages\User
    

    Sublime View in Browswer - https://github.com/adampresley/sublime-view-in-browser (Tried with Linux and it works)

    0 讨论(0)
  • 2020-12-02 04:38

    Windows7 FireFox/Chrome:

        {
           "cmd":["F:\\Program Files\\Mozilla Firefox\\firefox.exe","$file"]
        }
    

    just use your own path of firefox.exe or chrome.exe to replace mine.

    Replace firefox.exe or chrome.exe with your own path.

    0 讨论(0)
  • 2020-12-02 04:46

    On mac and sublime text 3 , which version is 3103, the content should be

    {
        "shell_cmd": "open -a 'Google Chrome' '$file'"
    }
    
    0 讨论(0)
  • 2020-12-02 04:47

    "Open in Browser context menu for HTML files" has been added in the latest build (2207). Its release date was 25 June 2012.

    0 讨论(0)
  • 2020-12-02 04:48

    On windows launching default browser with a predefined url:

    Tools > Build System > New Build System:

    {
        "cmd": ["cmd","/K","start http://localhost/projects/Reminder/"]
    }
    

    ctrl + B and voila!

    0 讨论(0)
提交回复
热议问题