问题
I would like to format my html with a command, like i do in visual studio, using CTRL-K-D. Is this possible in atom.io? If not, are there other options?
回答1:
Atom does not have a built-in command for formatting html. However, you can install the atom-beautify package to get this behavior.
- Press CTRL + SHFT + P to bring up the command palette (CMD + SHFT + P on a Mac).
- Type Install Packages to bring up the package manager.
- Type beautify into the search box.
- Choose atom-beautify or one of the other packages and click Install.
- Now you can use the default keybinding for atom-beautify CTRL + ALT + B to beautify your HTML (CTRL + OPTION + B on a Mac).
回答2:
There are a few packages for prettifying HTML. You can find them by searching the Atom package archive:
- Navigate to the Atom site
- Click the Packages link
- Enter "prettify" in the search box
Or just go to this link: 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.
When the package is installed, follow its instructions for how to activate its capabilities.
回答3:
https://github.com/Glavin001/atom-beautify
Includes many different languages, html too..
回答4:
You can add atom beauty package for formatting text in atom..
file --> setting --> Install
then you type atom-beautify in search area.
then click Package button.. select atom beuty and install it.
next you can format your text using (Alt + ctrl + b) or right click and select beautify editor contents
回答5:
- Go to "Packages" in atom editor.
- Then in "Packages" view choose "Settings View".
- Choose "Install Packages/Themes".
- Search for "Atom Beautify" and install it.
来源:https://stackoverflow.com/questions/24189068/is-there-a-command-for-formatting-html-in-the-atom-io-editor