Emmet for Sublime Text

Overview

This plugin is deprecated and no longer maintained, please use new version.


Emmet for Sublime Text

Official Emmet plugin for Sublime Text.

How to install

Warning: this plugin may not work at all in some OSes since it written in JavaScript and uses PyV8 and Google V8 binaries to run. If you experience problems or editor crashes please fill an issue.

With 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 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.

Available actions

Increment/Decrement Number actions:

  • Increment by 1: Ctrl+↑
  • Decrement by 1: Ctrl+↓
  • Increment by 0.1: Alt+↑
  • Decrement by 0.1: Alt+↓
  • Increment by 10: ⌥⌘↑ / Shift+Alt+↑
  • Decrement by 10: ⌥⌘↓ / Shift+Alt+↓

Extensions support

You can easily extend 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 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 Ctrl+E (“Expand Abbreviation”) and Ctrl+U (“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, Stylus and PostCSS. 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: add expand_abbreviation_by_tab command for tab key for required syntax scope selectors. To get current syntax scope selector, press ⇧⌃P (OSX) or Ctrl+Alt+Shift+P, 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:

{
  "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 Tab key, just like regular snippets. On the other hand, due to dynamic nature and extensive syntax, sometimes you may get unexpected results. This section describes how Tab handler works and how you can fine-tune it.

By default, Tab handler works in a limited syntax scopes: HTML, XML, HAML, CSS, SASS/SCSS, LESS, PostCSS and strings in programming languages (like JavaScript, Python, Ruby etc.). It means:

  • You have to switch your document to one of the syntaxes listed above to expand abbreviations by Tab key.
  • With Ctrl-E shortcut, you can expand abbreviations everywhere, its scope is not limited.
  • When you expand abbreviation inside strings of programming languages, the output is generated with special output profile named line that generates output as a single line.

To fine-tune Tab key handler, you can use the following settings in user’s Emmet.sublime-settings file:

  • disable_tab_abbreviations_for_scopes — a comma-separated list of syntax scopes where Tab key handler should be disabled. For example, if you want disable handler inside strings of programming languages and HAML syntax, your setting will look like this:
"disable_tab_abbreviations_for_scopes": "text.haml, string"
  • disabled_single_snippet_for_scopes — a comma-separated list of syntax scopes where Tab handler should be disabled when expanding a single abbreviation. Currently, ST doesn’t provide API for getting list of native snippets. So, for example, if you try to expand a php abbreviation, it will be passed to Emmet which outputs <php></php> instead of PHP block as defined in native ST snippets. As a workaround, if you’re trying to expand a single abbreviation inside scope defined in disabled_single_snippet_for_scopes setting Emmet will look for its name inside its own snippets catalog first, inside known_html_tags setting second and if it’s not found, it allows ST to handle it and expand native abbreviation, if matched.
  • known_html_tags — a space-separated list of all known HTML tags used for lookup as described above.

If you’re unhappy with Emmet tab handler behavior, you can disable it: just add "disable_tab_abbreviations": true into user’s Preferences.sublime-settings file.

Disable automatic vendor prefixes insertion

If your workflow already includes an automated task for CSS vendor prefixing (such as Autoprefixer), you can disable Emmet's automatic vendor prefixes insertion adding this option to your user’s Emmet.sublime-settings file:

{
  "preferences": {
    "css.autoInsertVendorPrefixes": false
  }
}
Comments
  • Add PostCSS

    Add PostCSS

    I want to add PostCSS support so I can use Emmet in Sublime Text with PostCSS syntax highlighting. This syntax file using scss scope for now, but I want to switch it to postcss. I haven't switched it yet because users of PostCSS syntax haven't possibility to use Emmet. So I want add postcss scope support to Emmet first, and then switch syntax file to it.

    I haven't change snippets.json and emmet-app.js as I understand they came from emmetio/emmet repository. So I've made a PR to that repository: https://github.com/emmetio/emmet/pull/411.

    opened by hudochenkov 7
  • Support

    Support "Lorem" and "lorem" for the lipsum generator

    Resolves https://github.com/sergeche/emmet-sublime/issues/345 Update to support "Lorem" not just "lorem" and "Lipsum" not just "lipsum"

    opened by vinayraghu 4
  • Support for pug

    Support for pug

    This simple pull request add support for pug, and keep previous support for jade.

    Referencing issues:

    • Add Pug support (ex Jade) - #643
    • Jade has been renamed to pug - #2184

    Sounds good for me. :smile:

    opened by amaurycatelan 1
  • Added scope for play templates when Play plugin is installed

    Added scope for play templates when Play plugin is installed

    I noticed emmet plugin stopped working for tab completion when the syntax was set to the appropriate one when Play2 plugin is installed. These changes fixed the problem for me. I'm fairly new to the sublime related settings so feel free to chime in if something I did was naive.

    opened by CoreyKaylor 1
  • Template element

    Template element

    • Added the <template> html5 element to the list of known html elements for tab completion: http://www.html5rocks.com/en/tutorials/webcomponents/template/).
    • Added a snippet shortcut tem
    opened by daftgopher 1
  • changed the tabstop inside the body tag to be the final position($0)

    changed the tabstop inside the body tag to be the final position($0)

    changed snippets for html:4t, html:4s, html:xt, html:xs, html:xxs, html:5.

    Detail: changed all <body>\n\t${child}${2}\n</body> to <body>\n\t${child}$0\n</body>

    Why: I see no point that every time people start a new html, having to tab to be end then go back to the body. Or pressing when inside the body tag.

    opened by princemaple 1
  • Extract default settings from emmet-app.js to sublime-settings

    Extract default settings from emmet-app.js to sublime-settings

    Users of emmet plugin must know all customisable settings without code view. My usecase - i write sass with semicolon on end of line, but emmet dont put them by default. I had decided to rewrite the emmet's sass function but find this settings. Also change style of some comments in Emmet.sublime-settings like in general Preferences.sublime-settings.

    opened by fliptheweb 1
  • - префикс -ms- в градиентах.

    - префикс -ms- в градиентах.

    Префикс -ms- не поддерживается в градиентах. Градиенты будут поддерживаться в IE 10 и сразу без префикса. Подсмотрел на http://www.css3files.com/gradient/ и http://caniuse.com/#feat=css-gradients

    opened by lancedikson 1
  • Use new Sublime Text 3 setting workflow

    Use new Sublime Text 3 setting workflow

    Use side-by-side settings and keybindings introduced in Sublime Text 3 Build 3124 (22 September 2016). It works exactly the same as Sublime Text settings: opens two columns tab, first column — default settings, second column — user settings.

    Before:

    screenshot 2018-12-23 at 12 53 34

    After:

    screenshot 2018-12-23 at 12 52 34

    This is breaking backward compatibility with Sublime Text 2, which is ok, in my opinion, having in mind Sublime Text 3 was released almost 6 years ago.

    opened by hudochenkov 0
  • Add TypeScriptReact JSX expanding support

    Add TypeScriptReact JSX expanding support

    Problem

    At the moment it need to add some user settings to emmet after install it to proper jsx expanding in TypeScriptReact syntax, but it can be done out of the box, this PR do that :)

    Without jsx extending:

    without

    With jsx extending:

    with

    opened by gebeto 0
  • Update README.md

    Update README.md

    i browsed your source code and realized you were checking for user settings http_proxy... i added it to my user prefs, and it worked! you should document it in some fashion, as i suggest. thanks!

    opened by btmurrell 0
Owner
Sergey Chikuyonok
Sergey Chikuyonok
💡 Full-featured code intelligence and smart autocomplete for Sublime Text

SublimeCodeIntel This Code Intelligence plugin for Sublime Text provides an interface to CodeIntel. CodeIntel is a code intelligence engine that was p

null 5.1k Dec 27, 2022
The code linting framework for Sublime Text 3

SublimeLinter The code linting framework for Sublime Text. No linters included: get them via Package Control. Installation Install SublimeLinter and l

null 2k Jan 8, 2023
Emmet like Abbreviation to generate and wrap Laravel Blade Component with markup

Laravel Blade Emerald Emmet like Abbreviation to generate and wrap Laravel Blade Component with markup ?? Features Generate HTML in a Blade file via p

Aqua 32 Sep 6, 2022
Integrates the Trix Editor with Laravel. Inspired by the Action Text gem from Rails.

Integrates the Trix Editor with Laravel. Inspired by the Action Text gem from Rails. Installation You can install the package via composer: composer r

Tony Messias 267 Jan 4, 2023
Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Number to Bangla Number, Word or Month Name in Laravel | Get Wordpress Plugin Laravel package to convert English numbers to Bangla number or Bangla te

Md. Rakibul Islam 50 Dec 26, 2022
Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Number to Bangla Number, Word or Month Name in Laravel | Get Wordpress Plugin Laravel package to convert English numbers to Bangla number or Bangla te

Md. Rakibul Islam 50 Dec 26, 2022
An online communication application that provides a real-time or live transmission of text messages from sender to receiver.

Realtime-chat-application An online communication application that provides a real-time or live transmission of text messages from sender to receiver.

isha 2 Aug 15, 2022
Bracket and tag highlighter for Sublime Text

BracketHighlighter Bracket Highlighter matches a variety of brackets such as: [], (), {}, "", '', <tag></tag>, and even custom brackets. This was orig

Isaac Muse 1.7k Dec 27, 2022
Enhancements to Sublime Text sidebar. Files and folders.

Sidebar Enhancements In other languages Japanese - http://taamemo.blogspot.jp/2012/10/sublime-text-2-sidebarenhancements.html?m=1 Russian - https://ww

Tito 2.1k Dec 27, 2022
💡 Full-featured code intelligence and smart autocomplete for Sublime Text

SublimeCodeIntel This Code Intelligence plugin for Sublime Text provides an interface to CodeIntel. CodeIntel is a code intelligence engine that was p

null 5.1k Dec 27, 2022
The code linting framework for Sublime Text 3

SublimeLinter The code linting framework for Sublime Text. No linters included: get them via Package Control. Installation Install SublimeLinter and l

null 2k Jan 8, 2023
A Sublime Text 3 package for highlighting both Sass and SCSS syntax.

Syntax Highlighting for Sass This is a Sublime Text 3 package which purely forced on highlighting both Sass and SCSS syntax as accuracy as possible. P

Peiwen Lu 291 Jun 26, 2022
MagentoSnippets - Magento Front End Snippets, plugin for Sublime Text

MagentoSnippets Magento Front End Snippets, plugin for Sublime Text. This tool serves to aid the productivity during the Magento's theme development t

MageFront 27 Nov 1, 2022
Emmet like Abbreviation to generate and wrap Laravel Blade Component with markup

Laravel Blade Emerald Emmet like Abbreviation to generate and wrap Laravel Blade Component with markup ?? Features Generate HTML in a Blade file via p

Aqua 32 Sep 6, 2022
Text - Simple 1 Class Text Manipulation Library

Text - Simple 1 Class Text Manipulation Library Do you remember PHP's string functions? If not, just wrap you text with Text! It will save a minute on

Kazuyuki Hayashi 51 Nov 16, 2021
Create videos programmatically in the cloud from PHP: add watermarks, resize videos, create slideshows, add soundtrack, voice-over with text-to-speech (TTS), text animations.

Create videos programmatically in the cloud from PHP: add watermarks, resize videos, create slideshows, add soundtrack, voice-over with text-to-speech (TTS), text animations.

null 6 Oct 21, 2022
Laminas\Text is a component to work on text strings

laminas-text This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Laminas Project 38 Dec 31, 2022
Zend\Text is a component to work on text strings from Zend Framework

zend-text Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-text. Zend\Text is a component to work on text strings. It cont

Zend Framework 31 Jan 24, 2021
PHP library for parsing plain text email content.

EmailReplyParser EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby.

William Durand 606 Dec 8, 2022
🐘🎓📝 PHP Library providing an easy way to spellcheck multiple sources of text by many spellcheckers

PHP-Spellchecker Check misspellings from any text source with the most popular PHP spellchecker. About PHP-Spellchecker is a spellchecker abstraction

Philippe SEGATORI 257 Jan 2, 2023