Emmet plugin for <textarea>
This plugin is automatically compiled from the Emmet core. If you want to contribute features or fix bugs, please do this in plugin source.
To add Emmet support and basic code editor features (like Tab key handler and formatted linebreak insertion) to your <textarea>
boxes:
- Add
<script src="emmet.min.js"></script>
into your page - Run this JavaScript code:
emmet.require('textarea').setup({
pretty_break: true, // enable formatted line breaks (when inserting
// between opening and closing tag)
use_tab: true // expand abbreviations by Tab key
});
Additionally, you can add special classes to your <textarea>
element to control Emmet behavior:
emmet-syntax-NAME
: set syntaxNAME
for current<textarea>
:html
,css
,xml
etc.emmet-profile-NAME
: set one of the predefined profile.emmet-use_tab-BOOL
: enable (yes
) or disable (no
) Tab expander on current<textarea>
.emmet-pretty_break-BOOL
: enable (yes
) or disable (no
) formatted linebreak insertion on current<textarea>
.no-emmet
: disable Emmet actions on current<textarea>
.
Overriding keybindings
To override default keybindings, simply create global emmetKeymap
object, the same as default one but with your own keybindings.