Is There a Command for Formatting Html in the Atom Editor?
I Would Like to Format My Html with a Command, as I Do in Visual Studio, Using Ctrl+K+D. Is This Possible in Atom? If Not, Are There Other Options? 6 Answers...
I would like to format my HTML with a command, as I do in Visual Studio, using Ctrl+K+D. Is this possible in Atom? If not, are there other options?
6 Answers
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).
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:
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.
Includes many different languages, html too..
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
- Go to "Packages" in atom editor.
- Then in "Packages" view choose "Settings View".
- Choose "Install Packages/Themes".
- Search for "Atom Beautify" and install it.
Not Just HTML, Using atom-beautify - Package for Atom, you can format code for HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more) in Atom within a matter of seconds.
To Install the atom-beautify package :
- Open Atom Editor.
- Press Ctrl+Shift+P (Cmd+Shift+P on mac), this will open the atom Command Palette.
- Search and click on
Install Packages & Themes. A Install Package window comes up. - Search for
Beautifypackage, you will see a lot of beautify packages. Install any. I will recommend foratom-beautify. - Now Restart atom and TADA! now you are ready for quick formatting.
To Format text Using atom-beautify :
- Go to the file you want to format.
- Hit Ctrl+Alt+B (Ctrl+Option+B on mac).
- Your file is formatted in seconds.