简体   繁体   English

atom.io 自动创建html基本结构

[英]atom.io auto create html basic structure

Im using atom.io for some time now and really like it.我现在使用 atom.io 有一段时间了,真的很喜欢它。 there is just one thing im missing.我只缺少一件事。 I used to use brackets and sublime before and they both had a feature where you could create the basic structure of a html documents by just typing html.我以前使用过括号和 sublime,它们都有一个功能,您可以通过键入 html 来创建 html 文档的基本结构。

this would just set the html, head and body tag.这只会设置 html、head 和 body 标签。 created the charset meta, title and link to css file.创建了字符集元、标题和指向 css 文件的链接。

I create a lot of html files a day so it would be really helpfull if I know the shortcode or the package which supports this!我每天创建很多 html 文件,所以如果我知道支持它的短代码或包,那将非常有帮助!

You're looking for autocomplete-snippets .您正在寻找autocomplete-snippets

Simply type html and press Enter只需输入html并按Enter

Here's a terrible GIF to prove it:这是一个糟糕的 GIF 来证明这一点:

在此处输入图片说明

There is a nice Plugin, called emmet: https://atom.io/packages/emmet有一个不错的插件,叫做 emmet: https ://atom.io/packages/emmet

When you got that, you just have to type ! -> tab当你得到它时,你只需要输入! -> tab ! -> tab in an empty document. ! -> tab空文档中的! -> tab You get pretty much the same result as @hatchet GIF.你得到的结果与@hatchet GIF 几乎相同。

If you have disabled the autocomplete functionality mentioned in the currently accepted answer, or want more flexibility than that allows, there is a file-templates package: https://atom.io/packages/file-templates如果您禁用了当前接受的答案中提到的自动完成功能,或者想要更多的灵活性,则有一个file-templates包: https : //atom.io/packages/file-templates

Here are some basic instructions.这里有一些基本的说明。

  • To install the package: edit->preferences->install->file-templates .安装包: edit->preferences->install->file-templates
  • To save the template: packages->new template from this file .保存模板: packages->new template from this file
  • To open a new file with that template, just hit ctrl-alt-n and select it.要使用该模板打开一个新文件,只需按ctrl-alt-n并选择它。

If we install Emmet package we are not getting the boiler plate code.如果我们安装 Emmet 包,我们将不会获得样板代码。 So I disabled emmet and it is working fine for me.所以我禁用了 emmet,它对我来说工作正常。

!tab is the command u seek. !tab 是您要查找的命令。 But it won't work unless you create a file and save it with the html extension...但是除非您创建一个文件并使用 html 扩展名保存它,否则它将无法工作...

So go create a new file in the directory u want, call it index.html and now go type !tab因此,在您想要的目录中创建一个新文件,将其命名为 index.html,然后输入 !tab

It should work 100%, if not be sure u have emmet installed.如果不确定您是否安装了 emmet,它应该可以 100% 工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM