Sublime Forum

How to auto indent tag with colons?

#1

Hi all, I’m quite new on Sublime Text 3.
I have some aspx files (sharepoint), with tags like <Sharepoint:SpDatasource attr="blahblahblah"...> or <asp:content...>
I cannot indent because of the “:”, if I remove it, it works.
Do I have to setup specific parameter somewhere to be able to achieve this ?

Thanx in advance

Phil

0 Likes

#2

what syntax/package are you using to highlight your ASPX files?

by “auto indent tag” do you mean you type <asp:content> Enter and it doesn’t increase indentation on the next line, or something else?

also, those are namespaces and the separator is called a colon, not a semi-colon :wink:

0 Likes

#3

Hi Keith,
Thanks for your reply
I tried ASP, (HTML) ASP, HTML, XML.
Indent tag, I mean re-indent, with Ctrl+K, Ctrl+F

*you’re right, Colon, sorry.

Thank you.
Phil

0 Likes

#4

it should be possible to use the same advice from

and add : to the regex character class, to get this working for the HTML (ASP) syntax. Note that this syntax is designed for Classic ASP, however, so you may be better off using
https://packagecontrol.io/packages/HTML%20(C%23)

0 Likes

#5

Ok thanks, I’ll try.

0 Likes

#6

I changed the regex from [A-Za-z0-9-] to [A-Za-z0-9\-:]
The regex is correct since i tested it, it finds correctly the ‘decrease indent’ tags as the ‘increase indent tags’.
But the indentation still just do nothing.
I found a workaround by using IndentX package, which does what I want to do.

Thanks for your time,

PH

0 Likes