Sublime Forum

What "@" in quick panel can be applied to , Can I change it?

#1

Hi guys, I really love the ‘@’(find function/method/id attribute in file, bring up by Ctrl+R) feature of sublime text, but I want to know:

  1. What thing can @ be applied to , as far as I know, function, class is fine, also the id attribute can be @ed , but what things else?

  2. How to change the behaviour of @, I mean, how to let @ be applied to other certain things that I specified? like “words that begin with @”? I know its behaviour can be changed, because I have a plugin called “PlainTask”(witch deals with .todo file) installed, and the @ can be applied to other thing in .todo file rather than function/class/id.

thanks in advance, sorry for my bad English.

0 Likes

#2

Goto Symbol reads *.tmPreferences files to detrmine how to populate the list in any given syntax.

PlainTasks uses this one:
github.com/aziz/PlainTasks/blob … references

It basically only has two moving parts:

  • scope
  • and an optional “transformation” which can be one or more regular expressions.

Here’s a more convoluted example:
github.com/alehandrof/BetterGoT … references

It’s still quite straightforward, no?

As long as the file ends in “.tmPreferences”, Sublime will parse it. The rest of the name and its location are irrelevant.

Hope this helps,
Alex

0 Likes

#3

Useful links, thanks, Alex! It really helped me to understand how @symbol looking for its matching words, and the XML tag is really self-explanatory.

But I just couldn’t figure out how the scope string be set, like what does “text.todo keyword” mean? text in .todo file that is a keyword? I don’t know. Use my example again, How can I set to look for words begin with @ symbol that in .txt file?

Thanks again!

Unopoo

0 Likes

#4

Scopes are defined in .tmLanguage files:
docs.sublimetext.info/en/latest/ … -selectors

sublime.wbond.net/packages/ScopeHunter

0 Likes