Home Download Buy Blog Forum Support

Shortcut to goto "HTML-TAG Open/Close Element"

Shortcut to goto "HTML-TAG Open/Close Element"

Postby StevenRas on Fri Mar 23, 2012 5:17 pm

Hi guys,

I am searching for a key command and don't know if sublime already has it??

OK, let's say I have an html page loaded with an Unordered List:
Code: Select all
<ul>
  <li>.....................</li>
  <li>.....................</li>
  <li>.....................</li>
  <li>.....................</li>
  <li>.....................</li>
</ul>


The curser is on the opening "<ul>".... is there a key command to jump the the closing tag "</ul>"???

This would be really cool!! I find it takes me a lot of time to navigate thru the html code and this "hierarchy" feature could come in really handy...

Any ideas?

Thanks for your support
Steven
StevenRas
 
Posts: 11
Joined: Fri Mar 23, 2012 4:58 pm

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby agibsonsw on Fri Mar 23, 2012 7:20 pm

I don't know if there is a shortcut for this, or whether someone has already build a command for it :?:

In the meantime, you could make us of the code-folding arrow, or Ctrl-Shift-a (on Windows) selects the matching closing tag.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby StevenRas on Mon Mar 26, 2012 12:37 pm

I think Sublime definetly needs this shortcut. There more I edit HTML the more I totally miss it... :-/

Does anyone know regular expressions good enough to program an macro and post it here???
StevenRas
 
Posts: 11
Joined: Fri Mar 23, 2012 4:58 pm

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby facelessuser on Mon Mar 26, 2012 2:04 pm

I don't know if you use BracketHighlighter, but I could easily add such a feature to that plugin. Since I have a simple framework for tapping into matched brackets and tags, I could throw it together in no time. I will try and get that in when I get a little free time, maybe today.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby atomi on Mon Mar 26, 2012 3:28 pm

Maybe it's just me but I'd rather use goto symbol to get to where I need to be.
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby facelessuser on Mon Mar 26, 2012 3:54 pm

Bracket Highlighter now jumps between tags better. Alt + Up and Alt + Down will jump you between open and closing tags. This is the same shortcut to jump between brackets as well in BracketHighlighter.

Do to the way the code changed, you may have to restart ST2 for it to start working proper.
facelessuser
 
Posts: 1567
Joined: Tue Apr 05, 2011 7:38 pm

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby tito on Mon Mar 26, 2012 4:17 pm

awesome thanks a lot =)
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 854
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby StevenRas on Tue Mar 27, 2012 8:09 am

Oh yeah!!! THanks that works great!!!!!
StevenRas
 
Posts: 11
Joined: Fri Mar 23, 2012 4:58 pm

Re: Shortcut to goto "HTML-TAG Open/Close Element"

Postby StevenRas on Tue Mar 27, 2012 8:13 am

Now I just got another idea...

lets say I am at the end of the "</ul>" and I press ALT-DOWN. Right now there is nothing happening.... Instead of doing nothing it would be cool if the highlight would now go to the next TAG. So if the is a "<DIV>" right underneath the <ul></ul> -> the upper DIV will be highlighted. It would be good to stay in the same DOM hirarchy level in this case... (don't select the inner div elements.

This would be cool as you could use those 2 commands to just navigate quickly thru the whole html!!

Great stuff!
StevenRas
 
Posts: 11
Joined: Fri Mar 23, 2012 4:58 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 36 guests