Atom 编辑器自定义 autocompletes/suggestions

Atom-editor customize autocompletes/suggestions

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

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

而不是默认值

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

您描述的自动完成功能称为 snippet in GitHub Atom's terminology. You can change these by overriding the input snippet provided by the language-html Atom 附带的程序包。

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

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

确保在HTML选择了语言的文档中测试我们更新后的代码段之前保存文件。