Emmet plugin Atom editor
Installation
- In Atom, open Preferences (Settings on Windows)
- Go to Install section
- Search for
Emmet
package. Once it found, clickInstall
button to install package.
Manual installation
You can install the latest Emmet version manually from console:
cd ~/.atom/packages
git clone https://github.com/emmetio/emmet-atom
cd emmet-atom
npm install
Then restart Atom editor.
Features:
- Expand abbreviations by Tab key.
- Multiple cursor support: most Emmet actions like Expand Abbreviation, Wrap with Abbreviation, Update Tag can run in multi-cursor mode.
- Interactive actions (Interactive Expand Abbreviation, Wrap With Abbreviation, Update Tag) allows you to preview result real-time as you type.
- Better tabstops in generated content: when abbreviation expanded, hit Tab key to quickly traverse between important code points.
- Emmet v1.1 core.
Please report any problems at issue tracker.
Tab key
Currently, Emmet expands abbreviations by Tab key only for HTML, CSS, Sass/SCSS and LESS syntaxes. Tab handler scope is limited because it overrides default snippets.
If you want to make Emmet expand abbreviations with Tab key for other syntaxes, you can do the following:
- Use Open Your Keymap menu item to open your custom
keymap.cson
file. - Add the following section into it:
'atom-text-editor[data-grammar="YOUR GRAMMAR HERE"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
Replace YOUR GRAMMAR HERE
with actual grammar attribute value. The easiest way to get grammar name of currently opened editor is to open DevTools and find corresponding <atom-text-editor>
element: it will contain data-grammar
attribute with value you need. For example, for HTML syntax itβs a text html basic
.
You can add as many sections as you like for different syntaxes. Note that default snippets will no longer work, but you can add your own snippets in Emmet.
Default Keybindings
You can change these in Preferences > Keybindings.
Command | Darwin | Linux/Windows |
---|---|---|
Expand Abbreviation | tab or shift + β + e | tab or ctrl + e |
Expand Abbreviation (interactive) | alt + β + enter | ctrl + alt + enter |
Wrap with Abbreviation | ctrl + w | ctrl + alt + w |
Balance (outward) | ctrl + d | ctrl + shift + e |
Balance (inward) | alt + d | ctrl + shift + 0 |
Go to Matching Pair | ctrl + alt + j | ctrl + alt + j |
Next Edit Point | ctrl + β | ctrl + alt + β |
Previous Edit Point | ctrl + β | ctrl + alt + β |
Select Next Item | ctrl + shift + β | ctrl + shift + . |
Select Previous Item | ctrl + shift + β | ctrl + shift + , |
Toggle Comment | β + / | ctrl + shift + / |
Split/Join Tag | shift + β + j | ctrl + shift + ` |
Remove Tag | β + ' | ctrl + shift + ; |
Evaluate Math Expression | shift + β + y | ctrl + shift + y |
Increment Number by 0.1 | ctrl + alt + β | alt + β |
Decrement Number by 0.1 | ctrl + alt + β | alt + β |
Increment Number by 1 | ctrl + alt + β + β | ctrl + β |
Decrement Number by 1 | ctrl + alt + β + β | ctrl + β |
Increment Number by 10 | ctrl + alt + β + shift + β | shift + alt + β |
Decrement Number by 10 | ctrl + alt + β + shift + β | shift + alt + β |
Reflect CSS value | shift + β + r | ctrl + shift + r |
Update Image Size | ctrl + i | ctrl + u |
Encode/Decode image to data:URL | ctrl + shift + i | ctrl + ' |
Update Tag | ctrl + shift + u | ctrl + shift + ' |
Merge Lines | shift + β + m | ctrl + shift + m |
All actions and their keyboard shortcuts are available under Packages > Emmet menu item.
Extensions support
You can easily extend Emmet with new actions and filters or customize existing ones. In Preferences > Emmet, set Extensions path to folder with Emmet extensions. By default, itβs ~/emmet
, e.g. emmet
folder in your system HOME folder.