代码之家  ›  专栏  ›  技术社区  ›  user2635088

js/jsx文件中的sublimitetext2html自动完成

  •  2
  • user2635088  · 技术社区  · 10 年前

    我希望能够自动完成内部的HTML标记 js / jsx Sublime文本2中的文件。我已安装 Babel-sublime 但它不支持HTML自动完成。

    还有其他选择吗?

    编辑:HTML自动完成在 js文件 文件即 Emmet js文件 Sublime文本2中的文件。不必 jsx公司

    1 回复  |  直到 10 年前
        1
  •  2
  •   user2635088    10 年前

    所以我得到了 emmet 为之工作 js/jsx 通过将以下内容添加到用户的密钥绑定中,Sublime文本2中的文件 (Preferences -> Key Bindings - User)

    {
      "keys": ["tab"], 
      "command": "expand_abbreviation_by_tab", 
      // put comma-separated syntax selectors for which 
      // you want to expandEmmet abbreviations into "operand" key 
      // instead of SCOPE_SELECTOR.
      // Examples: source.js, text.html - source
      "context": [
    {
      "operand": "source.js", 
      "operator": "equal", 
      "match_all": true, 
      "key": "selector"
    }, 
    
    // run only if there's no selected text
    {
      "match_all": true, 
      "key": "selection_empty"
    },
    
    // don't work if completion popup is visible and you
    // want to insert completion with Tab. If you want to
    // expand Emmet with Tab even if popup is visible -- 
    // remove this section
    {
      "operand": false, 
      "operator": "equal", 
      "match_all": true, 
      "key": "auto_complete_visible"
    }, 
    {
      "match_all": true, 
      "key": "is_abbreviation"
    }
    

    ] } `