Override Emmet Snippets


#1

I’ve made a custom snippet to use in HTML. However, my custom snippet always gets clobbered by Emmet. Instead of inserting my snippet when I press tab, Emmet expands it into a tag. I’ve defined my snippet in my custom snippets file (which I’d think would take precedence over plugin snippets).

Any ideas?
Thanks!


#2

I’ve the same issue!

UPDATE:
i found a solution, you can change emmet keybinding from “tab” to “ctrl-e”.

here’s how to do it:

  1. open this file: ~/.atom/packages/emmet/keymaps/emmet.cson.
  2. find this line: 'tab': 'emmet:expand-abbreviation-with-tab' and just comment it.
  3. in the top of the file you will see that emmet will use this key now 'cmd-E', you can change it anyway.

Hint:
maybe it’s better to specify your keybindings inside the file ~/.atom/keymap.cson instead of editing the original package files.


#3

Open your Keymap and add

'.pane .editor:not(.mini)':
  'tab': 'snippets:expand'

This will override emmet’s expansion with tab so if you want to use emmet you’ll need to expand with ctrl+e


#4

Hey @felgeekpe - this solution sort of works but for some reason it doesn’t stop emmet from auto-completing non-existant tags.

For example, if you type ‘xyz’ and hit tab, emmet will output <xyz></xyz>

I know it is emmet doing this because if you disable it, it stops the behavior.

Wondering if there is more global solution? I tried the solution here too:

But the same issue crops up.


#5

I know this post is old but:
@patrickgilmour expanding xyz to <xyz></xyz> is intended behavior for Emmet. It is very useful in tools like Polymer and React. @felgeekpe has the right answer.