Open lombardi-gux opened 10 years ago
Did you tried ctrl+e?
ctrl-e
open the Find in Current Buffer
panel...
Search emmet:expand
in Keybindings settings. From there you can see the shortcuts for the command.
I have the same issue trying to add some html in a Laravel view
tab is not working but ctrl-e is.
I'm having the same issue in a .liquid file on windows 8. ctrl+e
works but tab
doesn't. In the key bindings for emmet emmet:expand-abbreviation
is set to ctrl+e
and emmet:expand-abbreviation-with-tab
is set to tab
In an .html
file tab works for expanding abbreviations.
is there a solution for completions on php?
@carloscarcamo I guess use ctrl-e, or invert ctrl-e and tab key binding maybe ? (waiting for a fix...)
This issue won’t be fixed because it interferes with default snippets. Tab expander intentionally works in HTML and CSS only, because only in this syntaxes Emmet can fully replace native editor snippets.
If you don’t care about native snippets and still want Emmet to expand abbreviations with Tab, try the following: https://github.com/emmetio/emmet-atom/issues/108#issuecomment-53386679
If anyone reads this, I found another way:
In your keybindings.cson, simply add
'.pane .editor:not(.mini)':
'tab': 'emmet:expand-abbreviation'
This will make Emmet works in .php files (overriding emmet:expand-abbreviation-with-tab
action)
Care this might cause conflicts with other plugins as autocomplete or autocomplete-plus.
edit: here is a keymap.cson resolving conflicts with emmet-atom and autocomplete-plus: https://gist.github.com/KeitIG/532134a7390eea142792
Thanks @KeitIG, was totally what I was looking for as I use both Emmet and Autocomplete-Plus with sass and razor files.
Now you can easily enable the Tab key for other languages. More info here.
I think this can be closed then.
FYI regarding the official info, you can use
'atom-text-editor[data-grammar*="html"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
instead of targeting a specific grammar (e.g. text html php
), this targets all grammars with html detected.
This doesn't fix php tags.
I want to be able to use emmet's div.className
tab completion as well as being able to type php
and it auto completes to <?php ?>
on tab... I can't seem to get the best of both worlds?
EDIT: I've found a fix for anyone else who's having the same issue... the following worked for me:
'atom-text-editor[data-grammar="text` html basic"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
'atom-text-editor:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
'.pane .editor:not(.mini)':
'tab': 'snippets:expand'
@rockethouse you nailed it! that solution works proper for me. thanks!
@rockethouse This worked for me for quite a while until I bumped into another problem. Say I type input
and expand it. The type
attribute is highlighted and if I change it to something like text and hit tab to get to the next tab stop, instead of doing that, it expands text
to <text></text>
which sucks.
For now, adding the cson code posted in #86 along with this seems to get things going smooth.
Finally got the solution for this issue. With this code in the keymap.cson it will work the same way as .html files.
'atom-pane atom-text-editor[data-grammar~="html"]:not([mini]):not(.autocomplete-active), atom-pane atom-text-editor[data-grammar~="html"]:not([mini]):not(.autocomplete-active), atom-pane atom-text-editor[data-grammar~="php"]:not([mini]):not(.autocomplete-active), atom-pane atom-text-editor[data-grammar~="php"]:not([mini]):not(.autocomplete-active), atom-pane atom-text-editor[data-grammar~="xml"]:not([mini]):not(.autocomplete-active)': 'enter': 'emmet:insert-formatted-line-break-only'
'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar="text html php"]:not([mini]), atom-text-editor[data-grammar~="erb"]:not([mini]), atom-text-editor[data-grammar~="jade"]:not([mini]), atom-text-editor[data-grammar~="css"]:not([mini]), atom-text-editor[data-grammar~="stylus"]:not([mini]), atom-text-editor[data-grammar~="sass"]:not([mini]), atom-text-editor[data-grammar~="scss"]:not([mini])': 'tab': 'emmet:expand-abbreviation-with-tab'
'atom-text-editor.autocomplete-active:not([mini])': 'tab': 'autocomplete-plus:confirm'
'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar="text html php"]:not([mini]), atom-text-editor[data-grammar~="jade"]:not([mini]), atom-text-editor[data-grammar="text html php"]:not([mini]), atom-text-editor[data-grammar~="css"]:not([mini]), atom-text-editor[data-grammar~="sass"]:not([mini])': 'tab': 'snippets:next-tab-stop'
@KeitIG Thanks so much!
@MikedeJong Thank you heaps!! Your fix works great.
For macOS Sierra user's ONLY:
I used alt-tab
because it makes sense to me, you can choose your own(Be aware that is isn't in use).
Atom(upper right next to apple logo) -> Keymap... -> paste it like this:
'.platform-darwin atom-text-editor:not([mini])':
'alt-tab': 'emmet:expand-abbreviation'
NOT LIKE THIS:
# '.platform-darwin atom-text-editor:not([mini])':
# 'alt-tab': 'emmet:expand-abbreviation'
Let me know if it doesn't work.
It happens to be Cmd + Shift + E on Mac :(
Is there a way to change Cmd + Shift + E on Mac to just Tab or no?
This might be due to this being a Wordpress template, where it by definition is a partial "html" file, but as you can see, trying to add a div with
div.foo[tab]
or.foo[tab]
does nothing.It works fine in a plain vanilla HTML file.