Skip to content

Instantly share code, notes, and snippets.

@ForestMars
Last active August 29, 2015 13:57
Show Gist options
  • Save ForestMars/9880001 to your computer and use it in GitHub Desktop.
Save ForestMars/9880001 to your computer and use it in GitHub Desktop.
Add Twig templates to Quickview
## How to add Twig templates to your OSX Quickview
## Due to the way OSX works you have to add new declarations for a file type to an application.
## That's bc of OSX's app-based approach (as opposed to the standard file based approach in Unix!)
## So you need to pick an application to add this definition to.
## I recommend using a free app you downloaded and not something you have licensed/registered.
# Find the Application in Finder, control-click it, and select "Show package contents"
# In the Contents directory, open up info.plist in your favourite editor.
# Look for the Unexported Type Declaration key:
<key>UTExportedTypeDeclarations</key>
# Add the following dictionary item:
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.plain-text</string>
</array>
<key>UTTypeDescription</key>
<string>Twig Template File</string>
<key>UTTypeIdentifier</key>
<string>org.sensiolabs.twig</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>org.sensiolabs.twig</key>
<string>TEXT</string>
<key>public.filename-extension</key>
<array>
<string>twig</string>
</array>
</dict>
</dict>
# From a terminal touch the application you added this to
# You should now see all your Twig templates working in Quickview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment