Thursday 28 November 2013

Sublime Textで更新されたHTMLファイルをすばやくブラウザでプレビューする方法

んで、これだけだとhtmlとかphp以外のファイルでも、更新のたびにブラウザがリロードされちゃってうざいんで、keybindに以下のcontextを設定する。これで、html, php, css, scssの時だけ保存と同時にブラウザを更新できるよー。

// Browser Refresh
{ "keys": ["super+s"], "command": "browser_refresh",
  "args": {
    "auto_save": true,
    "delay": 0.0,
    "activate_browser": false,
    "browser_name" : "Google Chrome"
  },
   "context": [
    {
      "key": "selector",
      "operator": "equal",
      "operand": "text.htm,text.html,source.php,source.scss,source.css"
    },
    { "key": "selector", "operator": "not_equal", "operand": "text.html.markdown" }
  ]
},

以上おしまい。

追記) markdownの保存時にもブラウザが更新されてウザイので、上記コードを一部変更しました。

No comments:

Post a Comment