【发布时间】: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
如何更改 Atom 中的自动完成功能,使 input 变为
<input type="text" placeholder="{cursor here}">
而不是默认的
<input type="{'button'|cursor here}" name="name" value="">
【问题讨论】:
标签: autocomplete code-snippets atom-editor
您所描述的自动完成功能在 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 选为语言。
【讨论】: