Here's an example of a standalone plugin that catches when you open a
*.search file and automatically applies the correct syntax and result regexes in order to add clickable files. Use
Tools > Developer > New Plugin... from the menu, replace the stub file with the following, then save it in the default location (your
User package as a
def on_load(self, view):
view.settings().set("result_file_regex", r'^([^ \t].*):$')
view.settings().set("result_line_regex", r"^ +([0-9]+):")
# In order for the regex options to take effect, another view needs
# to be given the focus temporarily.
This notices when a file with an extension of
.search is opened, and then automatically applies the appropriate syntax and result regular expressions to enable the ability to navigate the search results again. With this you don't need to have the setting you applied that makes the syntax apply via settings.
Note also that per the following forum post, in order for the result regex to take effect properly the view needs to be refocused; otherwise you get obscure messages in the console. As such the plugin also temporarily creates a new file, then closes it.