Skip to content

Instantly share code, notes, and snippets.

@xxxObiWan
Created February 3, 2012 10:13
Show Gist options
  • Save xxxObiWan/1729497 to your computer and use it in GitHub Desktop.
Save xxxObiWan/1729497 to your computer and use it in GitHub Desktop.
Latte syntax definition for Sublime Text 2 [#nettefw #latte #php]
<?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">
<!--
- @author Michal Mikoláš <[email protected]>
- @license CC BY <http://creativecommons.org/licenses/by/3.0/cz/>
-->
<dict>
<key>fileTypes</key>
<array>
<string>phtml</string>
<string>latte</string>
</array>
<key>name</key>
<string>Latte</string>
<key>scopeName</key>
<string>source.latte</string>
<key>patterns</key>
<array>
<dict> <!-- Whatever between { and } -->
<key>begin</key>
<string>\{\{?(?!\s)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.begin.latte</string>
</dict>
</dict>
<key>end</key>
<string>\}?\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.end.latte</string>
</dict>
</dict>
<key>name</key>
<string>source.latte</string>
<key>patterns</key>
<array>
<dict> <!-- Pair latte macros -->
<key>match</key>
<string>/?(block|foreach|form|if|else|snippet)\s*</string>
<key>name</key>
<string>keyword.control.latte</string>
</dict>
<dict> <!-- Single latte macros -->
<key>match</key>
<string>(var|link|plink|control|\!|label|input)\s*</string>
<key>name</key>
<string>keyword.operator.latte</string>
</dict>
<dict> <!-- Latte variables -->
<key>match</key>
<string>\$\$?[a-zA-Z_0-9]+\s*</string>
<key>name</key>
<string>variable.other.global.latte</string>
</dict>
<dict> <!-- Deprecated keywords -->
<key>match</key>
<string>widget</string>
<key>name</key>
<string>invalid.deprecated</string>
</dict>
<dict> <!-- Whatever else between { and } -->
<key>match</key>
<string>([^}$]|\s)*</string>
<key>name</key>
<string>source.latte</string>
</dict>
</array>
</dict>
<dict> <!-- Include HTML highlight -->
<key>include</key>
<string>text.html.basic</string>
</dict>
</array>
</dict>
</plist>
@Marax
Copy link

Marax commented Feb 8, 2012

Chybí ti tam ifset makro.

@xxxObiWan
Copy link
Author

Díky, přidáno do novější verze: https://gist.github.com/1738482

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