星期四, 10月 17, 2013

Tips:在Sublime Text 編輯html網頁時,利用tab鍵來跳出雙引號位置


在使用Sublime Text 編輯html網頁時,常常需要在不同的屬性間跳來跳去。如果可以在輸入完屬性後,利用tab鍵來跳出雙引號位置(Using tab to escape auto-completed quotes),會非常方便。
設定作法如下:

修改default key bindings:

{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
      [
         { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
         { "key": "auto_complete_visible", "operator": "not_equal", "operand": true },
         { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
         { "key": "following_text", "operator": "regex_contains", "operand": "^(\\]|\\)|\\}|>|\\\"|'|\\;)", "match_all": true }, 
{ "key": "has_next_field", "operator": "not_equal", "operand": true }
      ]
   }

參考資料來源:
http://www.sublimetext.com/forum/viewtopic.php?f=3&t=13337

沒有留言: