F
F
fantazerno2016-06-27 19:21:25
HTML
fantazerno, 2016-06-27 19:21:25

Goto symbol in project in Sublime Text?

Good afternoon!
For some reason, on command

{ "keys": ["ctrl+shift+r"], "command": "goto_symbol_in_project" }

when you enter the desired character (word), it searches only in styles.
I enter a class name and I want to find an html file, and it gives me only css

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sasha Chernykh, 2016-07-20
@fantazerno

Check that nothing seems to be broken.
To look for SashaClass<div class="SashaClass"></div> in the Sublime Text 3 tag . PreferencesBrowse Packages...User → create a file Symbol list - CSS.tmPreferences → paste 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>

To search for SashaTag<SashaTag></SashaTag> in Sublime Text 3 tag . PreferencesBrowse Packages...User → create a Symbol list - Tags.tmPreferences file → paste 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>

To in CSS
SashaTag {
  color: red;
}

Sublime Text 3 searched for SashaTag .
PreferencesBrowse Packages...User → create a file Symbol list - CSS.tmPreferences → paste 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>

So that <div id="SashaID"></div>Sublime Text 3 searches for SashaID in the tag .
PreferencesBrowse Packages...User → create a file Symbol list - ID.tmPreferences → paste 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>

As you can see, the words Tag: Classes: ID: and CSS: separate content types, we can choose whether we need an HTML or CSS syntax element.
It's probably not natively built in because the features aren't needed for most users.
Any symbols and their combinations throughout the project cannot be found using Ctrl+Shift+R . Alternative:
Thank you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question