Skip to content

Instantly share code, notes, and snippets.

@esttorhe
Created June 7, 2019 15:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esttorhe/9e25dc9922ba60246d23b044c2a27ba5 to your computer and use it in GitHub Desktop.
Save esttorhe/9e25dc9922ba60246d23b044c2a27ba5 to your computer and use it in GitHub Desktop.
Xcode Custom Search Scopes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>name</key>
<string>Source Code</string>
<key>predicate</key>
<dict>
<key>predicates</key>
<array>
<dict>
<key>operand</key>
<string>m</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>h</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>swift</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
</array>
<key>rule</key>
<string>all</string>
</dict>
<key>source</key>
<dict>
<key>file-source</key>
<string>workspace</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Modified Files</string>
<key>predicate</key>
<dict>
<key>predicates</key>
<array>
<dict>
<key>desired-status</key>
<string>any</string>
<key>rule</key>
<string>scm-status</string>
</dict>
</array>
<key>rule</key>
<string>all</string>
</dict>
<key>source</key>
<dict>
<key>file-source</key>
<string>workspace</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Base Strings</string>
<key>predicate</key>
<dict>
<key>predicates</key>
<array>
<dict>
<key>operand</key>
<string>Base.lproj</string>
<key>operator</key>
<string>contains</string>
<key>rule</key>
<string>file-path</string>
</dict>
<dict>
<key>predicates</key>
<array>
<dict>
<key>operand</key>
<string>strings</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>storyboard</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>xib</string>
<key>operator</key>
<string>contains</string>
<key>rule</key>
<string>file-extension</string>
</dict>
</array>
<key>rule</key>
<string>any</string>
</dict>
</array>
<key>rule</key>
<string>all</string>
</dict>
<key>source</key>
<dict>
<key>file-source</key>
<string>workspace</string>
</dict>
</dict>
</array>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>name</key>
<string>Source Code</string>
<key>predicate</key>
<dict>
<key>predicates</key>
<array>
<dict>
<key>operand</key>
<string>m</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>h</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>swift</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
</array>
<key>rule</key>
<string>all</string>
</dict>
<key>source</key>
<dict>
<key>file-source</key>
<string>workspace</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Modified Files</string>
<key>predicate</key>
<dict>
<key>predicates</key>
<array>
<dict>
<key>desired-status</key>
<string>any</string>
<key>rule</key>
<string>scm-status</string>
</dict>
</array>
<key>rule</key>
<string>all</string>
</dict>
<key>source</key>
<dict>
<key>file-source</key>
<string>workspace</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Base Strings</string>
<key>predicate</key>
<dict>
<key>predicates</key>
<array>
<dict>
<key>operand</key>
<string>Base.lproj</string>
<key>operator</key>
<string>contains</string>
<key>rule</key>
<string>file-path</string>
</dict>
<dict>
<key>predicates</key>
<array>
<dict>
<key>operand</key>
<string>strings</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>storyboard</string>
<key>operator</key>
<string>is-equal-to</string>
<key>rule</key>
<string>file-extension</string>
</dict>
<dict>
<key>operand</key>
<string>xib</string>
<key>operator</key>
<string>contains</string>
<key>rule</key>
<string>file-extension</string>
</dict>
</array>
<key>rule</key>
<string>any</string>
</dict>
</array>
<key>rule</key>
<string>all</string>
</dict>
<key>source</key>
<dict>
<key>file-source</key>
<string>workspace</string>
</dict>
</dict>
</array>
</plist>
@esttorhe
Copy link
Author

esttorhe commented Jun 7, 2019

After reading Paulo Andrade: Xcode: Search Scopes article I created the scopes in my local machine; but figured that wouldn't be enough.

Thus I decided to find where Xcode stores said information; which is a pretty straight forward location:

/Users/<username>/Library/Developer/Xcode/UserData/IDEDocumentationWindow.xcuserstate

This gist contain the exact same scopes defined by Paulo; if you haven't defined any custom ones just copy the plist and drop it in the location above; if you have scopes you'll have to copy the items from within the <array> tags and add them to your <array of scopes.

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