Sublime Forum

Highlight/Select Inner contents between tags or quotes

#1

Hi, I was wondering if there was a simple way to highlight or select the contents between tags?

I thought I saw something in the hours I’ve spent ramping up on ST2 that there was a way to select ever increasing ranges. However, I can’t seem to find it again.

1 Like

#2

check the shortcut under Selection -> Expand selection to tag

1 Like

#3

Thank you! I keep forgetting to look in the menu for things after being trained to the keyboard for everything.

0 Likes

#4

in HTML this does NOT select the content of the tag, it select the CONTENT AND the OPEN+CLOSE tag. How can I QUICKLY only select everything between two tags.

0 Likes

#5

What they said should work for you: Expand Selection To Tag (Ctrl + Shift + A)

<blockquote>
  <p>lorem ipsum</p>
</blockquote>

If your cursor is anywhere on line 2 after the first < then Ctrl + Shift + A will select just lorem ipsum.

Then repeating that keystroke will expand the selection to the p tags, and then up the tree. I don’t know why it’s including the tags for you initially.

0 Likes

#6

Sons of Anarchy

My CURSOR is at S**[CURSOR]**ons of Anarchy. Doing this command highlights
incorrectly like so…

what can i do to make it work right? this is on of the most useful features in the ENTIRE program

0 Likes

#7

it seems to work on a different HTML file… i then created two files with perfect w3c validation, and randomly it doesn’t always work. I guess this is why regex for smart selections suck :frowning:

0 Likes