- Emmet — the essential toolkit for web-developers
- 1664 Installs
This extension is allowed to:
- Send Network Requests
Emmet for Nova editor
Extension development is sponsored by Panic
Emmet is a web-developer’s toolkit for boosting HTML & CSS code writing.
With Emmet, you can type expressions (abbreviations) similar to CSS selectors and convert them into code fragment with a single keystroke. For example, this abbreviation:
...can be expanded into:
<li class="item1"><a href="">Item 1</a></li>
<li class="item2"><a href="">Item 2</a></li>
<li class="item3"><a href="">Item 3</a></li>
<li class="item4"><a href="">Item 4</a></li>
- Familiar syntax: as a web-developer, you already know how to use Emmet. Abbreviation syntax is similar to CSS Selectors with shortcuts for id, class, custom attributes, element nesting and so on.
- Dynamic snippets: unlike default editor snippets, Emmet abbreviations are dynamic and parsed as-you-type. No need to predefine them for each project, just type
MyComponent>custom-elementto convert any word into a tag.
- CSS properties shortcuts: Emmet provides special syntax for CSS properties with embedded values. For example,
bd1-s#f.5will be exampled to
border: 1px solid rgba(255, 255, 255, 0.5).
- Available for most popular syntaxes: use single abbreviation to produce code for most popular syntaxes like HAML, Pug, JSX, SCSS, SASS etc.
In Nova editor, pick Extensions > Extensions Library... menu item then find & install Emmet in opened dialog.
To expand Emmet abbreviation, type it in editor and run Editor > Emmet > Expand Abbreviation. For example, type
ul.nav>.item*4>a and hit Ctrl-E.
Also, abbreviation expander acts as autocomplete provider and automatically captures abbreviation as you type.
When you start typing in Emmet-supported document (HTML, XML CSS, etc.) Emmet detects if you’re typing something similar to abbreviation and provides auto-complete item with expanded abbreviation preview. Hit Tab or Enter key to expand it, hit Esc to cancel or use arrow keys to pick another completion item.
If you already have an abbreviation in document and you want to expand it, move caret to the end of abbreviation and invoke autocomplete (Esc by default) to capture abbreviation:
Writing Emmet abbreviations in JSX is a bit tricky: in most cases you’d expect Tab key to expand native Nova clips or completions and use Emmet for specific context only. So a default abbreviation capturing for every variable or snippet would annoy you.
To solve this problem, Emmet uses prefixed abbreviations in JSX: it will capture and expand abbreviation only if it’s prefixed with
Emmet detects camel-cased module notation in JSX:
Foo.Bar will be expanded as
<Foo.Bar></Foo.Bar> instead of
<Foo className="Bar"></Foo>. Expression attributes are supported as well:
In Nova editor, CSS abbreviations are enhanced with dynamic color snippets: you can type, for example,
#f.5 to quickly get
rgba(255, 255, 255, 0.5). Emmet automatically detects current context (CSS property or value) and allows you to expand abbreviations allowed in current context only.
Go to Extensions > Extensions Library..., click on Emmet in “Installed Extensions” section then go to Preferences pane to tune-up Emmet behavior like tag commenting and BEM support.
To set-up or change key binding for Emmet actions, go to Nova Preferences > Key Bindings, pick Extensions tab and find Emmet in it.
All the rest actions like Wrap with Abbreviation, Balance, Select Item etc. are also supported but doesn’t have default key bindings. You should either invoke these actions via Command Palette or create your own keyboard shortcuts in Nova preferences.
- Emmet now handles CSS abbreviations inside
- Minor fixes in CSS abbreviations.
- Greatly improved CSS abbreviation capturing: it should properly work for preprocessors like SCSS and LESS and provide better completions when full property name is entered.
- Abbreviation capturing now works in PHP and HTML+ERB syntaxes.
Emmet now acts as autocomplete provider: when you start typing abbreviation in know syntaxes (like HTML, CSS etc.) abbreviation will be tracked and autocomplete popup with abbreviation preview is displayed. Now you can use Tab key to expand Emmet abbreviation as a completion.
See README for more info.
Initial release with upcoming Emmet 2.