Sublime Forum

XML tag auto-close

#1

Hi,

I’m new to Sublime and it just might be the perfect editor if I could discover how to achieve XML tag auto-close.
What I mean is:

I type in and Sublime inserts for me.

HTML auto-completion doesn’t seem to work, because in XML you can (and will) name your tags whatever you want.

0 Likes

#2

Try this:

sublimetext.info/tips/autoclose- … snippet%29

Hope it helps,
G

0 Likes

#3

Hi. Snippets. Nice things.

I don’t know if yours works, because I don’t know how to trigger it. There is an existing XML snippet that’s seems even better, it pairs tags, so when you edit the start tag, you also edit the end tag. However, I don’t know how to trigger that one too.

It says <, TAB. If I press TAB though, it just inserts a Tabulator, like you’d expect it would. What am I missing?

0 Likes

#4

Does > + TAB work for you?

Maybe < + TAB doesn’t work due to autopairing of angle brackets.

Once saved under Packages\User, my snippet should kick in if you typed: tag + TAB.

0 Likes

#5

Wonderful, my friend. It worked indeed. Thank you!

0 Likes

#6

That’s right, take it off and it works.

0 Likes