Skip to content

Instantly share code, notes, and snippets.

@dbritto-dev
Forked from wesbos/tab-trigger.js
Created June 7, 2016 01:14
Show Gist options
  • Save dbritto-dev/94468e3048b6005fd83a1cc640a33c2d to your computer and use it in GitHub Desktop.
Save dbritto-dev/94468e3048b6005fd83a1cc640a33c2d to your computer and use it in GitHub Desktop.

Revisions

  1. @wesbos wesbos renamed this gist Nov 16, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @wesbos wesbos created this gist Nov 16, 2015.
    46 changes: 46 additions & 0 deletions tab-trigger.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    {
    "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": "meta.group.braces.round.js, text.html",
    "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"
    }
    ]
    }