You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Peter Varo's [Python 3](https://github.com/petervaro/python) syntax definition
9
8
10
-
as well as a number of my own changes to make things more consistent and understandable. For customized syntax highlighting taking advantage of all the new scopes, use PythonImproved with the [Neon Color Scheme](https://sublime.wbond.net/packages/Neon%20Color%20Scheme), or modify your own favorite color scheme with the scopes below.
9
+
as well as a number of my own changes to make things more consistent and understandable. For customized syntax highlighting taking advantage of all the new scopes, use **PythonImproved** with the [Neon Color Scheme](https://sublime.wbond.net/packages/Neon%20Color%20Scheme), or modify your own favorite color scheme with the scopes below.
11
10
12
11
## Installation and Use
13
12
@@ -19,13 +18,7 @@ While I haven't yet tried to install PythonImproved with TextMate, I can't think
19
18
20
19
If you prefer to modify your own color scheme, here is a list of new/modified scopes, along with some examples. It's not perfectly complete, but it's a start.
21
20
22
-
-`support.ipython.in` and `support.ipython.out`: [IPython](http://ipython.org)`In [1]:`/`Out [1]:` fields — designed for use with [SublimeREPL](https://sublime.wbond.net/packages/SublimeREPL)
23
-
-[Django](http://www.djangoproject.com)-specific:
24
-
-`support.type.django.model`: `(meta|models).``DecimalField`, `EmailField`, `ForeignKey`, `ManyToManyField`, etc.
25
-
-`support.other.django.module`: `django`, `django.contrib`, etc.
26
-
-`variable.other.django.settings`: [`settings.py`](https://docs.djangoproject.com/en/1.7/ref/settings/) options like `ADMINS`, `DATABASES`, `INSTALLED_APPS`, `MIDDLEWARE_CLASSES`, etc. Should be complete as of Django 1.7.
-`support.function.django.model`: model functions `get_object`, `get_list`, `get_count`, etc.
21
+
-`support.ipython.in` and `support.ipython.out`: [IPython](http://ipython.org)`In [1]:`/`Out [1]:` fields — designed for use with [SublimeREPL](https://sublime.wbond.net/packages/SublimeREPL). The cell number can be themed with a different color using `support.ipython.cell-number`.
-`keyword.control.import.python` now contains `import`, `from`, _and_`as`
31
24
-`keyword.other.python` now only contains `assert`—`as`, `del`, `exec`, and `print` have been relocated
@@ -46,13 +39,16 @@ def myfunc(self, # gotta have self
46
39
- New scopes for bytes, unicode, and raw/regex strings, thanks to [@simonzack](https://github.com/simonzack): `string.quoted.(single|double).(block|single-line).(bytes|bytes-raw|bytes-raw-regex).python`
47
40
- Also from @simonzack, highlighting of `self|cls` in parameter strings: `variable.parameter.function.(keyword|language)`
48
41
-`comment.line.note.python` is a comment line that contains `(BUG|FIXME|TODO|XXX)` at the beginning. `comment.line.note.notation.python` matches the actual word itself, so you can differentially highlight the word and the whole line:
49
-
42
+
50
43

51
44
52
-
-`constant.other.allcaps.python` captures variable names that are in all caps (`OPENING_PORT`, for example), assuming the convention that these are generally treated as constants in the code. This scope does not match `variable.other.django.settings`, so each can be colored independently. Matches `CONSTANT`, `class.CONSTANT` and the `CONSTANT` part of `CLASS.CONSTANT`, but not `CLASS.function()`, `class.FUNCTION()`, or `FUNCTION()`.
45
+
-`constant.other.allcaps.python` captures variable names that are in all caps (`OPENING_PORT`, for example), assuming the convention that these are generally treated as constants in the code. Matches `CONSTANT`, `class.CONSTANT` and the `CONSTANT` part of `CLASS.CONSTANT`, but not `CLASS.function()`, `class.FUNCTION()`, or `FUNCTION()`.
53
46
- Fixed the octal integers so the Python 3-style `0o123` is matched as well as the old-style `0123`
54
47
- Built-in functions like `any()`, `dict()`, `len()`, `raw_input()`, etc. now have their arguments highlighted just like any other function. Many thanks to [@facelessuser](https://github.com/facelessuser) for the regex, and [@FichteFoll](https://github.com/FichteFoll) for valuable discussion. For those working with Python 2, `print` is still a standalone keyword, as is `del`. If you can think of any others that should be as well, please [let me know](https://github.com/MattDMo/PythonImproved/issues/8).
55
48
- To facilitate hacking, I'm also including my `.YAML-tmLanguage` file in the repo, which I use for my day-to-day work (I really hate debugging regexes embedded in XML). Install [`AAAPackageDev`](https://sublime.wbond.net/packages/AAAPackageDev) for syntax highlighting, and tools for converting between YAML, JSON, and XML/Plist formats. [Neon](https://sublime.wbond.net/packages/Neon%20Color%20Scheme) of course has great coloring for the `.YAML-tmLanguage` format, and especially the regexes :)
49
+
- All Django-related stuff has been removed. If you want it back, just dig through the repo's history and you can find it. It was just too distracting.
50
+
- I removed the SQL-related stuff from the string definitions, because 1) somebody complained, and 2) like Django, it was distracting. It didn't cover all of SQL, only highlighted some keywords, and just wasn't worth it.
51
+
- Unicode escapes should now appear correctly in all strings, as with Python 3 all strings are Unicode. I think I got it right, if you think otherwise just let me know.
56
52
57
53
## Issues
58
54
@@ -61,11 +57,10 @@ If you have questions, concerns, or suggested improvements, I'd love to hear fro
This is free software. It is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International Public License](http://creativecommons.org/licenses/by-sa/4.0/). Feel free to use this in your own work. However, if you modify and/or redistribute it, please attribute me in some way, and distribute your work under this or a similar license. A shout-out or a beer would be appreciated.
This is free software. It is licensed under the [MIT License](http://opensource.org/licenses/MIT). Feel free to use this in your own work. However, if you modify and/or redistribute it, please attribute me in some way, and distribute your work under this or a similar license. A shout-out or a beer would be appreciated.
69
63
64
+
<ahref="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=R97MGGYES6GAJ&lc=US&item_name=Matthew%20D%2e%20Morrison&item_number=PythonImproved¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"><imgsrc="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif"border="0"name="Donate"alt="PayPal - The safer, easier way to pay online!"></a>
70
65
<p>
71
-
You can also [give on Gittip](https://www.gittip.com/on/github/MattDMo/).
66
+
You can also give on [Gratipay](https://www.gratipay.com/on/github/MattDMo/).
0 commit comments