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

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

    I have similar situation like you. I dont wannt sublime open editor for binary like jpg png files. Instead open system default application is more reasonable.

    1. create one Build. Just like the accepted answer. But it will both open default application and hex editor.
    2. Pulgin OpenDefaultApplication https://github.com/SublimeText/OpenDefaultApplication It will have context right click menu OpenInDefaultApplication. But It will both open default application and hex editor as well
    3. Pulgin: Non Text Files https://packagecontrol.io/packages/Non%20Text%20Files Add config in the user settting

      "binary_file_patterns": ["*.JPG","*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
      "prevent_bin_preview": true,
      "open_externally_patterns": [
         "*.JPG",
         "*.jpg",
         "*.jpeg",
         "*.JPEG",
         "*.png",
          "*.PGN",
         "*.gif",
          "*.GIF",
          "*.zip",
          "*.ZIP",
          "*.pdf",
          "*.PDF"
      ]
      

    I choose the third way, it's quite sutiable for me. It will open jpg file in system default application and quickly close the edit mode automaically at the same time. As to the first two ways, you can set "preview_on_click": false, to stop openning automaticlly the hex editor compromisely.

提交回复
热议问题