# Emmet for Sublime Text
[](http://codersclan.net/support/step1.php?repo_id=4)
Official [Emmet](http://emmet.io) plugin for Sublime Text.
* [How to install](#how-to-install)
* [Available actions](#available-actions)
* [Extensions support](#extensions-support)
* [Overriding keyboard shortcuts](#overriding-keyboard-shortcuts)
* [How to expand abbreviatoins with Tab key in other syntaxes](#how-to-expand-abbreviations-with-tab-in-other-syntaxes)
* [Notes about Tab key handler](#tab-key-handler)
## How to install
*Warning:* this plugin may not work at all in some OSes since it written in JavaScript and uses [PyV8](http://code.google.com/p/pyv8/) and [Google V8](https://developers.google.com/v8/) binaries to run. If you experience problems or editor crashes please [fill an issue](https://github.com/sergeche/emmet-sublime/issues).
With [Package Control](http://wbond.net/sublime_packages/package_control):
1. Run “Package Control: Install Package” command, find and install `Emmet` plugin.
2. Restart ST editor (if required)
Manually:
1. Clone or [download](https://github.com/sergeche/emmet-sublime/archive/master.zip) git repo into your packages folder (in ST, find Browse Packages... menu item to open this folder)
2. Restart ST editor (if required)
--------------
**WARNING**: When plugin is installed, it will automatically download required PyV8 binary so you have to wait a bit (see _Loading PyV8 binary_ message on status bar). If you experience issues with automatic PyV8 loader, try to [install it manually](https://github.com/emmetio/pyv8-binaries).
## Available actions ##
* [Expand Abbreviation](http://docs.emmet.io/actions/expand-abbreviation/) – <kbd>Tab</kbd> or <kbd>Ctrl+E</kbd>
* Interactive “Expand Abbreviation” — <kbd>Ctrl+Alt+Enter</kbd>
* [Match Tag Pair Outward](http://docs.emmet.io/actions/match-pair/) – <kbd>⌃D</kbd> (Mac) / <kbd>Ctrl+,</kbd> (PC)
* [Match Tag Pair Inward](http://docs.emmet.io/actions/match-pair/) – <kbd>⌃J</kbd> / <kbd>Shift+Ctrl+0</kbd>
* [Go to Matching Pair](http://docs.emmet.io/actions/go-to-pair/) – <kbd>⇧⌃T</kbd> / <kbd>Ctrl+Alt+J</kbd>
* [Wrap With Abbreviation](http://docs.emmet.io/actions/wrap-with-abbreviation/) — <kbd>⌃W</kbd> / <kbd>Shift+Ctrl+G</kbd>
* [Go to Edit Point](http://docs.emmet.io/actions/go-to-edit-point/) — <kbd>Ctrl+Alt+→</kbd> or <kbd>Ctrl+Alt+←</kbd>
* [Select Item](http://docs.emmet.io/actions/select-item/) – <kbd>⇧⌘.</kbd> or <kbd>⇧⌘,</kbd> / <kbd>Shift+Ctrl+.</kbd> or <kbd>Shift+Ctrl+,</kbd>
* [Toggle Comment](http://docs.emmet.io/actions/toggle-comment/) — <kbd>⇧⌥/</kbd> / <kbd>Shift+Ctrl+/</kbd>
* [Split/Join Tag](http://docs.emmet.io/actions/split-join-tag/) — <kbd>⇧⌘'</kbd> / <kbd>Shift+Ctrl+`</kbd>
* [Remove Tag](http://docs.emmet.io/actions/remove-tag/) – <kbd>⌘'</kbd> / <kbd>Shift+Ctrl+;</kbd>
* [Update Image Size](http://docs.emmet.io/actions/update-image-size/) — <kbd>⇧⌃I</kbd> / <kbd>Ctrl+U</kbd>
* [Evaluate Math Expression](http://docs.emmet.io/actions/evaluate-math/) — <kbd>⇧⌘Y</kbd> / <kbd>Shift+Ctrl+Y</kbd>
* [Reflect CSS Value](http://docs.emmet.io/actions/reflect-css-value/) – <kbd>⇧⌘R</kbd> / <kbd>Shift+Ctrl+R</kbd>
* [Encode/Decode Image to data:URL](http://docs.emmet.io/actions/base64/) – <kbd>⇧⌃D</kbd> / <kbd>Ctrl+'</kbd>
* Rename Tag – <kbd>⇧⌘K</kbd> / <kbd>Shift+Ctrl+'</kbd>
[Increment/Decrement Number](http://docs.emmet.io/actions/inc-dec-number/) actions:
* Increment by 1: <kbd>Ctrl+↑</kbd>
* Decrement by 1: <kbd>Ctrl+↓</kbd>
* Increment by 0.1: <kbd>Alt+↑</kbd>
* Decrement by 0.1: <kbd>Alt+↓</kbd>
* Increment by 10: <kbd>⌥⌘↑</kbd> / <kbd>Shift+Alt+↑</kbd>
* Decrement by 10: <kbd>⌥⌘↓</kbd> / <kbd>Shift+Alt+↓</kbd>
## Extensions support ##
You can easily [extend](http://docs.emmet.io/customization/) Emmet with new actions and filters or customize existing ones. In `Emmet.sublime-settings`, define `extensions_path` setting and Emmet will load all `.js` and `.json` files in specified folder at startup.
The default value of `extensions_path` is `~/emmet`, which points to _emmet_ folder inside your OS user’s home folder.
Also, you can create sections named as extension files (e.g. `snippets`, `preferences` and `syntaxProfiles`) inside user’s `Emmet.sublime-settings` file and write your customizations there. See [original settings file](https://github.com/sergeche/emmet-sublime/blob/master/Emmet.sublime-settings#L61) for examples.
## Overriding keyboard shortcuts ##
Sublime Text is a great text editor with lots of features and actions. Most of these actions are bound to keyboard shortcuts so it’s nearly impossible to provide convenient plugin shortcuts for third-party plugins.
If you’re unhappy with default keymap, you can disable individual keyboard shortcuts with `disabled_keymap_actions` preference of `Emmet.sublime-settings` file.
Use a comma-separated list of action names which default keyboard shortcuts should be disabled. For example, if you want to release <kbd>Ctrl+E</kbd> (“Expand Abbreviation”) and <kbd>Ctrl+U</kbd> (“Update Image Size”) shortcuts, your must set the following value:
"disabled_keymap_actions": "expand_abbreviation, update_image_size"
You should refer `Default (Your-OS-Name).sublime-keymap` file to get action ids (look for `args/action` key).
To disable all default shortcuts, set value to `all`:
"disabled_keymap_actions": "all"
Not that if you disabled any action like so and you’re create your own keyboard shortcut, you **should not** use `emmet_action_enabled.ACTION_NAME` context since this is the key that disables action.
## How to expand abbreviations with Tab in other syntaxes
Emmet expands abbreviations in limited syntaxes only: HTML, CSS, LESS, SCSS and Stylus. The reason to restrict Tab handler to a limited syntax list is because it breaks native Sublime Text snippets.
If you want to abbreviation with Tab in other syntaxes (for example, JSX, HAML etc.) you have to tweak your [keyboard shorcuts settings](http://sublime-text-unofficial-documentation.readthedocs.org/en/sublime-text-2/reference/key_bindings.html): add `expand_abbreviation_by_tab` command for `tab` key for required syntax *scope selectors*. To get current syntax scope selector, press <kbd>⇧⌃P</kbd> (OSX) or <kbd>Ctrl+Alt+Shift+P</kbd>, it will be displayed in editor status bar.
Go to `Preferences` > `Key Bindings — User` and insert the following JSON snippet with properly configured scope selector instead of `SCOPE_SELECTOR` token:
```js
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
"operand": "SCOPE_SELECTOR",
"operator": "equal",
"match_all": true,
"key": "selector"
},
// run only if there's no selected text
{
"match_all": true,
"key": "selection_empty"
},
// don't work if there are active tabstops
{
"operator": "equal",
"operand": false,
"match_all": true,
"key": "has_next_field"
},
// don't work if completion popup is visible and you
// want to insert completion with Tab. If you want to
// expand Emmet with Tab even if popup is visible --
// remove this section
{
"operand": false,
"operator": "equal",
"match_all": true,
"key": "auto_complete_visible"
},
{
"match_all": true,
"key": "is_abbreviation"
}
]
}
```
### Tab key handler ###
Emmet plugin allows you to expand abbreviations with <kbd>Tab</kbd> key, just like regular snippets. On the other hand, due to dynamic nature and extensive syntax, sometimes you may get unexpected r

clxiaoqiang
- 粉丝: 0
最新资源
- 《深入解析陈天奇所研究的机器学习编译领域》 《陈天奇视角下的机器学习编译技术探析》 《聚焦陈天奇:机器学习编译核心内容解读》 《陈天奇相关机器学习编译知识深度梳理》 全面剖析陈天奇主导的机器学习编译
- 医疗设备高精度流量分配系统设计与控制:基于Python和MATLAB/Simulink的机电一体化系统建模与优化(含详细代码及解释)
- 陈天奇所著的机器学习编译相关内容
- 【电子电路设计】基于AMP32F103的嵌入式系统与BMS电路设计及仿真:电源管理、通信接口与保护电路的深度解析(含详细代码及解释)
- 基于径向基函数(RBF)的参数化水平集方法在拓扑优化中的应用,通过88行MATLAB代码实现(含详细代码及解释)
- 【量子计算与数值分析】针对非线性薛定谔方程的对称指数波积分器设计:低正则性条件下高效稳定的数值求解方案(含详细代码及解释)
- 控制系统基于HMM的二维Markov跳跃系统有限区域异步H∞滤波器设计与性能分析:结合Lyapunov函数和LMI技术解决工程实际问题(含详细代码及解释)
- 岩体工程基于改进等效粘弹性介质方法的层状岩体地震波传播分析:参数影响与工程应用(含详细代码及解释)
- 这篇文章深入探讨了班轮运输战术层面规划的集成优化方法,特别是针对异质船队和环境因素的综合考虑(含详细代码及解释)
- 无线通信基于RSSI的高效TIS测量技术:无线移动站灵敏度评估系统优化(含详细代码及解释)
- 这篇文章详细探讨了牵引车-半挂车系统在平面运动中的非线性动力学行为和稳定性分析(含详细代码及解释)
- 电力电子LCL型并网逆变器主动阻尼的等效微分方法研究:基于网侧电感电压反馈的谐振抑制与谐波优化设计(含详细代码及解释)
- NLP 作业:RNN 与 Attention 机器翻译模型及 Transformer 代码学习
- 这篇文章详细介绍了在线全息图分割算法的实现、优化及应用,涵盖从基础算法到复杂场景下的改进方案(含详细代码及解释)
- 【APP开发与运营管理】APP后台功能详解:系统配置与数据分析助力高效运营(含详细代码及解释)
- 电子工程基于Python的电子电路设计与仿真:小信号分析、频率响应及保护电路设计全流程解析(含详细代码及解释)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


