autoclose-html
autoclose-html copied to clipboard
Auto tab when pressing enter on inline elements
Say I have the following in my editor <p></p>
with my cursor in the center. When pressing new line, I'd like the cursor to appear in the same way it does when autoclosing non inline elements - a blank line is inserted and the cursor is tabbed in one level. Like so:
<p>
|
</p>
Thanks for all the feedback!
This isn't entirely in the scope of this package, as I'd imagined it. Currently only acts on the user pressing '>'
that isn't to say it's not possible to build this functionality but perhaps it'd be better as it's own package. I can look into it this weekend, if it's not too much trouble I'll maybe add it under a preference.
I am also looking for this behavior. Every once in a while I want a typically inline tag to be multiline. Right now I have to hit enter twice, then go up a line and tab.
It would be great if you could add the reverse behavior as well: when you press backspace in an empty multiline tag, it should collapse to an inline tag:
<p>
|
</p>
press backspace...
<p>|</p>
An ok-but-not-ideal solution would be custom keybindings for this, as suggested in #120.
+1 for me as well. @benlind I would like something similar as well, but my preference is to have all autocomplete tags to be inline, then pressing enter would cause it to a multiline tag. I know Coda 2 has this functionality.
@mattberkowitz Any plans to do something like this?