是否有用于在 Atom 编辑器中格式化 HTML 的命令?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24189068/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a command for formatting HTML in the Atom editor?
提问by user376456
回答by Stuart Hallows
Atom does not have a built-in command for formatting html. However, you can install the atom-beautifypackage to get this behavior.
Atom 没有用于格式化 html 的内置命令。但是,您可以安装atom-beautify包来获得此行为。
- Press CTRL+ SHFT+ Pto bring up the command palette (CMD+ SHFT+ Pon a Mac).
- Type Install Packagesto bring up the package manager.
- Type beautifyinto the search box.
- Choose atom-beautifyor one of the other packages and click Install.
- Now you can use the default keybinding for atom-beautify CTRL+ ALT+ Bto beautify your HTML (CTRL+ OPTION+ Bon a Mac).
- 按CTRL+ SHFT+P以弹出命令调色板(CMD+ SHFT+P在Mac)。
- 键入Install Packages以打开包管理器。
- 键入美化到搜索框中。
- 选择atom-beautify或其他软件包之一,然后单击Install。
- 现在您可以使用 atom-beautify CTRL+ ALT+的默认键绑定B来美化您的 HTML(在 Mac 上为CTRL+ OPTION+ B)。
回答by Lee
There are a few packages for prettifying HTML. You can find them by searching the Atom package archive:
有一些用于美化 HTML 的包。您可以通过搜索 Atom 包存档找到它们:
- Navigate to the Atom site
- Click the Packages link
- Enter "prettify" in the search box
- 导航到Atom 站点
- 单击包链接
- 在搜索框中输入“美化”
Or just go to this link: https://atom.io/packages/search?q=prettify
或者直接访问这个链接:https: //atom.io/packages/search?q=prettify
Once you've selected a package that does what you want you can install it by using the command: apm install [package name]
from the command line or install it using the interface in Preferences.
一旦你选择了一个你想要的包,你就可以使用以下命令安装它:apm install [package name]
从命令行或使用首选项中的界面安装它。
When the package is installed, follow its instructions for how to activate its capabilities.
安装软件包后,请按照其说明激活其功能。
回答by pungggi
https://github.com/Glavin001/atom-beautify
https://github.com/Glavin001/atom-beautify
Includes many different languages, html too..
包括许多不同的语言,html 也是..
回答by Jayantha
You can add atom beauty package for formatting text in atom..
您可以添加 atom 美化包用于在 atom.. 中格式化文本。
file --> setting --> Install
文件 --> 设置 --> 安装
then you type atom-beautifyin search area.
然后在搜索区域输入atom-beautify。
then click Package button.. select atom beuty and install it.
然后单击 Package 按钮.. 选择 atom beuty 并安装它。
next you can format your text using (Alt + ctrl + b) or right click and select beautify editor contents
接下来,您可以使用 (Alt + ctrl + b) 或右键单击并选择美化编辑器内容来格式化文本
回答by Ajay
- Go to "Packages" in atom editor.
- Then in "Packages" view choose "Settings View".
- Choose "Install Packages/Themes".
- Search for "Atom Beautify" and install it.
- 转到原子编辑器中的“包”。
- 然后在“包”视图中选择“设置视图”。
- 选择“安装包/主题”。
- 搜索“Atom Beautify”并安装它。