Goto symbol in project in Sublime Text?

Good day!

Somehow in the team
{ "keys": ["ctrl+shift+r"], "command": "goto_symbol_in_project" }

when you enter the desired character(words) looking for only styles.
I enter the class name and want to find the html file, and it gives me only css
July 8th 19 at 11:33
1 answer
July 8th 19 at 11:35
Solution
Check, like nothing should go wrong.

1. Displaying classes, and not only their selectors

In the tag <div class="SashaClass"></div> Sublime Text 3 was looking SashaClass.

PreferencesBrowse Packages...User → create a file Symbol list - CSS.tmPreferences → insert the following code into it and save.

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
 <string>Symbol List: Classes</string>
<key>scope</key>
 <string>text.html meta.class-name.html</string>
<key>settings</key>
<dict>
<key>symbolIndexTransformation</key>
 <string>s/^/Class: /</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>


2. Displaying HTML tags

In the tag <sashatag></sashatag> Sublime Text 3 was looking SashaTag. PreferencesBrowse Packages...User → create a file Symbol list - Tags.tmPreferences → insert the following code into it and save.

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
 <string>Symbol List: Tags</string>
<key>scope</key>
 <string>text.html entity.name.tag</string>
<key>settings</key>
<dict>
<key>symbolIndexTransformation</key>
 <string>s/^/Tag: /</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>


3. Mapping selectors of the HTML tags

Below in CSS

SashaTag {
 color: red;
}

Sublime Text 3 was looking SashaTag.

PreferencesBrowse Packages...User → create a file Symbol list - CSS.tmPreferences → insert the following code into it and save.

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
 <string>Symbol List: CSS</string>
<key>scope</key>
<string>meta.selector.css</string>
<key>settings</key>
<dict>
<key>symbolIndexTransformation</key>
 <string>s/^/CSS: /</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>


4. Display the ID and not just their selectors

In the tag <div id="SashaID"></div> Sublime Text 3 was looking SashaID.

PreferencesBrowse Packages...User → create a file Symbol list - ID.tmPreferences → insert the following code into it and save.

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
 <string>Symbol List: ID</string>
<key>scope</key>
 <string>text.html meta.toc-list.id.html</string>
<key>settings</key>
<dict>
<key>symbolIndexTransformation</key>
 <string>s/^/ID: /</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>


Ctrl+Shift+R → the results in the screenshots:

LOPS08m.pngww0U1La.pngV0YRzYK.png

As you can see, words Tag: Classes: ID: and CSS: separating content types, we can vybiraet whether we need a syntax element HTML or CSS.

It's probably not integrated as native, because functions are not needed for most users.



Any characters and their combinations for the entire project using Ctrl+Shift+R to not find work. Alternative:


Search by project

Ctrl+Shift+F → push the button with the three dots to the right → select the project folder → then click on the button Findthat above the button with the three dots → in a separate file you will see the options.

NLGxnIe.png

Thank you.
Great! - Jama commented on July 8th 19 at 11:38
updated 4th paragraph. It's better, because you do not have to edit the default configuration file when you upgrade Sublime Text 3 can reschedule. - Ursula_Treut commented on July 8th 19 at 11:41
: Could you tell me how to search in the project, but according to a specific mask file ? (only in *.css) - Jama commented on July 8th 19 at 11:44

Find more questions by tags HTMLSublime Text