Skip to content

Commit b01f2e6

Browse files
author
MattDMo
committed
Removed Django and SQL stuff, corrected Unicode escapes
1 parent 11a2e17 commit b01f2e6

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

README.md

+11-16
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ A better Python `.tmLanguage` syntax highlighting definition for [Sublime Text](
44

55
- the original TextMate and Sublime Text `Python.tmLanguage` files
66
- facelessuser's [Better Python](https://github.com/facelessuser/sublime-languages)
7-
- Djaniero's [Django syntax](https://github.com/squ1b3r/Djaneiro)
87
- Peter Varo's [Python 3](https://github.com/petervaro/python) syntax definition
98

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.
1110

1211
## Installation and Use
1312

@@ -19,13 +18,7 @@ While I haven't yet tried to install PythonImproved with TextMate, I can't think
1918

2019
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.
2120

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.
27-
- `support.function.django.view`: view functions `get_list_or_404`, `get_object_or_404`, `load_and_render`, `loader`, `render_to_response`, `render`
28-
- `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`.
2922
- `constant.numeric.integer.(long).binary.python`: binary literals `0b00101010`, `0b00101010L`
3023
- `keyword.control.import.python` now contains `import`, `from`, _and_ `as`
3124
- `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
4639
- 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`
4740
- Also from @simonzack, highlighting of `self|cls` in parameter strings: `variable.parameter.function.(keyword|language)`
4841
- `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+
5043
![BUG FIXME TODO XXX line highlighting](http://pigimal.com/img/comment.line.note.png)
5144

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()`.
5346
- Fixed the octal integers so the Python 3-style `0o123` is matched as well as the old-style `0123`
5447
- 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).
5548
- 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.
5652

5753
## Issues
5854

@@ -61,11 +57,10 @@ If you have questions, concerns, or suggested improvements, I'd love to hear fro
6157

6258
## License
6359

64-
&copy; 2013-2014 Matt Morrison <[email protected]>.
65-
66-
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.
60+
&copy; 2013-2015 Matt Morrison <[email protected]>.
6761

68-
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0;align:center" src="http://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a>
62+
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.
6963

64+
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=R97MGGYES6GAJ&lc=US&item_name=Matthew%20D%2e%20Morrison&item_number=PythonImproved&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"><img src="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>
7065
<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

Comments
 (0)