Skip to content

Instantly share code, notes, and snippets.

@tiffon
Created December 19, 2012 01:17
  • Star 13 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tiffon/4333623 to your computer and use it in GitHub Desktop.
Tricked-out Find in Files... results
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Find Results</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<!-- add the filetype extensions, here -->
<!-- these are XML formatted files: -->
<string>^([^ ].*\.(?:xml|tmLanguage|hidden-tmLanguage|tmTheme):)$</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.filename.find-in-files</string>
</dict>
</dict>
<key>end</key>
<string>^[^ ]</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<!-- reference to something in the "repository" -->
<string>#line-numbers</string>
</dict>
<dict>
<!-- which syntax should match up to the filetype extensions listed above: -->
<!-- to find out what the "scopeName" is, refer to the corresponding *.tmLanguage file -->
<!-- for XML, this is ~/Library/Application Support/Sublime Text 2/Packages/XML/XSL.tmLanguage -->
<key>include</key>
<string>text.xml</string>
</dict>
</array>
</dict>
<dict>
<!-- *.html files -->
<key>begin</key>
<string>^([^ ].*\.html:)$</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.filename.find-in-files</string>
</dict>
</dict>
<key>end</key>
<string>^[^ ]</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#line-numbers</string>
</dict>
<dict>
<!-- I'm working with django templates a lot, lately, so I have it set to that syntax -->
<key>include</key>
<string>text.html.django</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<!-- CSS -->
<string>^([^ ].*\.css:)$</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.filename.find-in-files</string>
</dict>
</dict>
<key>end</key>
<string>^[^ ]</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#line-numbers</string>
</dict>
<dict>
<key>include</key>
<!-- etc.. -->
<string>source.css</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>^([^ ].*\.js:)$</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.filename.find-in-files</string>
</dict>
</dict>
<key>end</key>
<string>^[^ ]</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#line-numbers</string>
</dict>
<dict>
<key>include</key>
<string>source.js</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>^([^ ].*):$</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.filename.find-in-files</string>
</dict>
</dict>
</dict>
<!-- this is the initial settings for this file -- (I think declaration order defines precedence) -->
<!-- keeping it here for unrecognized / configured filetypes -->
<dict>
<key>match</key>
<string>^ +([0-9]+) </string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.numeric.line-number.find-in-files</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>^ +([0-9]+):</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.numeric.line-number.match.find-in-files</string>
</dict>
</dict>
</dict>
</array>
<!-- stuff in the "repository" is just the line number matching that were originally in the file -->
<key>repository</key>
<dict>
<key>line-numbers</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>^ +([0-9]+) </string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.numeric.line-number.find-in-files</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>^ +([0-9]+):</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.numeric.line-number.match.find-in-files</string>
</dict>
</dict>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>text.find-in-files</string>
</dict>
</plist>
@dogoku
Copy link

dogoku commented Feb 11, 2014

I've added a quick usage guide for ST2 and ST3 users in my fork. Here's a link to it
https://gist.github.com/dogoku/8933871#file-a-readme-md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment