【问题标题】:Atom-editor customize autocompletes/suggestionsAtom 编辑器自定义自动完成/建议
【发布时间】:2016-03-28 10:47:31
【问题描述】:

如何更改 Atom 中的自动完成功能,使 input 变为

<input type="text" placeholder="{cursor here}">

而不是默认的

<input type="{'button'|cursor here}" name="name" value="">

【问题讨论】:

    标签: autocomplete code-snippets atom-editor


    【解决方案1】:

    您所描述的自动完成功能在 GitHub Atom 的术语中称为 snippet。您可以通过覆盖 Atom 附带的 language-html 包提供的 input sn-p 来更改这些。

    用户定义的片段存储在您的 Atom 配置文件中,您可以通过转到 File -> Snippets... 来访问它,这将在编辑器中打开文件,然后您可以将以下内容粘贴到文件末尾

    '.text.html':
      'Input':
        'prefix': 'input'
        'body': '<input type="text" name="${1:name}">$0'
    

    确保在测试我们更新后的 sn-p 之前保存文件,并将 HTML 选为语言。

    【讨论】:

      猜你喜欢
      • 2017-11-30
      • 1970-01-01
      • 1970-01-01
      • 2014-09-21
      • 2011-02-15
      • 2015-07-14
      • 1970-01-01
      • 2016-03-23
      • 1970-01-01
      相关资源
      最近更新 更多