Open serkandurusoy opened 10 years ago
you can disable key tab in Emmet by comment line in keymap.cson
Hi, thank you for your suggestion, unfortunately, that is not a great option for those like me who have grown very accustomed to using the tab key.
It would be great if emmet distinguished between what's typed under the cursor and pass along the tab key to atom so that other snippet completions work.
For example when I type mtp
there is no expansion available to that in emmet, so it automatically expand it to <mtp></mtp>
however, it should do nothing and let other snippets work, in my case meteor snippets.
Furthermore, this is only a problem with html
files, not javascript
files, so there obviously is something out of the ordinary going on there.
Hello, i use snippets in js and coffeescript without any problems or unwanted expansions,but with the html there unexpected behavior with a several letters in Atom.
For example when i type a+tab
, that extends <a href="#"></a>
what is normal ! but when you type inside a snippets aera
, and tab key to jump to the next section that extends aer<a href="#"></a>
This behavior makes the edition in snippets unavailable!.
I made a package for Zurb Foundation, and unfortunately I must restrict the use of the tab key for the edition. I think it is a basic behavior in Atom I will make research on this subject. otherwise i will post in Atom. By.
Great, thank you for looking into this.
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
Yep, having the same issue here. I'd like to find a way to disable expanding unknown tags. This is the one niggle I have that's keeping me from jumping off Sublime, which seems to handle this pretty well.
You can make autocomplete-plus
show snippets
by installing autocomplete-snippets package. In this way,
Wow! | I | ♥ | Love | markdown! | Cheers!! |
---|
Thank's for sharing!
If anyone is still having problems expanding HTML attribute snippets with emmet-atom
+ autocomplete-plus
(Atom 0.199.0), my work around is to overwrite enter
in my keymap.cson
:
'atom-text-editor:not(mini).autocomplete-active':
'enter': 'autocomplete-plus:confirm'
This makes it possible to use emmet expansions with tab
and built-in expansions with enter
.
It's still happening in 0.207.0. I've created 2 snippets to add the wiredep tags: wirecss and wirejs.
When I write wirecss
I can see that the snippet is recognized by Atom, as it show the green arrow in the dropdown. But when I press tab I get <wirecss></wirecss>
instead.
That's very annoying, to be honest.
The way to "fix" this is to edit the expand-abbreviation-with-tab command to check whether the current symbol left of the cursor is a valid emmet abbreviation, and call abortKeyBinding() if it isn't. For reference: https://atom.io/docs/v1.0.0/behind-atom-keymaps-in-depth
autocomplete-snippets works great for starting a snippet, but if you have multiple tab stops, advancing will trigger Emmet again
Here's a solution by adding some rules in your own keymap. You may need to either add the text html php
grammar to the final keymap if you haven't set up php
to extend html
context in Emmet
Are there any updates on this? The goal is this:
...right? Sublime acts this way. Maybe some smarty-pants can look at their implementation?
I would also appreciate Emmet developers to enable an option in the setting, which would stop epanding non-existing words into pair tags and let the snippets expand by tab instead.
You should try new Emmet 2 alpha instead: https://github.com/emmetio/atom-plugin
As may be followed at https://github.com/ThusStyles/meteor-snippets/issues/4#issuecomment-57050554 emmet's snippet expansion with tab on html files breaks other custom snippets' tab expansion.