Skip to content

Instantly share code, notes, and snippets.

@DanielOaks
Created January 15, 2013 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielOaks/4540008 to your computer and use it in GitHub Desktop.
Save DanielOaks/4540008 to your computer and use it in GitHub Desktop.
Sublime Text 2 Python format string syntax highlighting, Python.tmLanguage diff
--- Python.tmLanguage
+++ Python-formatstrings.tmLanguage
@@ -1171,7 +1171,7 @@
<key>constant_placeholder</key>
<dict>
<key>match</key>
- <string>(?i:%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?[hL]?[a-z%])</string>
+ <string>(?i:%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?[hL]?[a-z%])|(?&lt;=[({{)+]|[^{])({[0-9a-zA-Z]*(\.[0-9a-zA-Z]*)?(\[([^\])]*)\])?(![rsa])?(:)?})(?=(}})+|[^}])</string>
<key>name</key>
<string>constant.other.placeholder.python</string>
</dict>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment