Skip to content

Commit 91430a4

Browse files
committed
README: Convert to markdown
1 parent aaa002e commit 91430a4

File tree

3 files changed

+131
-152
lines changed

3 files changed

+131
-152
lines changed

README.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Python syntax highlighting for Vim
2+
=========================================
3+
4+
This is an enhanced version of the original Vim 6.1 Python syntax highlighting
5+
`python.vim` by Neil Schemenauer.
6+
7+
Features
8+
--------
9+
10+
* Added support for Python 3 syntax highlighting
11+
* Added commands `Python2Syntax` and `Python3Syntax` allowing to easily switch
12+
between Python 2 and Python 3.
13+
* Updated string highlighting
14+
* Enhanced special symbols highlighting inside strings
15+
* Enhanced highlighting of numeric constants
16+
* Added optional highlighting for %-formatting inside strings
17+
* Added highlighting for magic comments: source code encoding and
18+
shebangs (`#!`)
19+
* Added highlighting for new exceptions and builtins
20+
* Added highlighting for doctests
21+
* Added highlighting for new `@decorator` syntax introduced in Python 2.4a2
22+
* Added highlighting for the following errors:
23+
* Invalid symbols in source file
24+
* Mixing spaces and tabs
25+
* Invalid numeric constants
26+
* Invalid %-formatting inside strings
27+
* Invalid variable names
28+
* Trailing spaces (Enabled with `g:python_highlight_space_errors`)
29+
30+
Folding is done by the plugin [SimpylFold](https://github.com/tmhedberg/SimpylFold).
31+
32+
How to install
33+
--------------
34+
35+
Use one of the following plugin managers:
36+
37+
* [dein](https://github.com/Shougo/dein.vim)
38+
* [vim-plug](https://github.com/junegunn/vim-plug)
39+
* [vundle](https://github.com/VundleVim/Vundle.vim)
40+
* [pathogen](https://github.com/tpope/vim-pathogen)
41+
42+
Configuration
43+
-------------
44+
45+
### Option variables
46+
47+
Set variable to `1` to enable or `0` to disable.
48+
49+
For example to enable all syntax highlighting features you can add the
50+
following command to your `~/.config/nvim/init.vim` or `~/.vimrc`:
51+
```vim
52+
let g:python_highlight_all = 1
53+
```
54+
| Variable | Description | Default |
55+
| --------------------------------------------- | -------------------------------------------------------------- | ------- |
56+
| `g:python_version_2` | Python 2 mode | `0` |
57+
| `b:python_version_2` | Python 2 mode (buffer local) | `0` |
58+
| `g:python_highlight_builtins` | Highlight builtin functions and objects | `0` |
59+
| `g:python_highlight_builtins` | Highlight builtin functions and objects | `0` |
60+
| `g:python_highlight_builtin_objs` | Highlight builtin objects only | `0` |
61+
| `g:python_highlight_builtin_funcs` | Highlight builtin functions only | `0` |
62+
| `g:python_highlight_exceptions` | Highlight standard exceptions | `0` |
63+
| `g:python_highlight_string_formatting` | Highlight `%` string formatting | `0` |
64+
| `g:python_highlight_string_format` | Highlight syntax of `str.format` syntax | `0` |
65+
| `g:python_highlight_string_templates` | Highlight syntax of `string.Template` | `0` |
66+
| `g:python_highlight_indent_errors` | Highlight indentation errors | `0` |
67+
| `g:python_highlight_space_errors` | Highlight trailing spaces | `0` |
68+
| `g:python_highlight_doctests` | Highlight doc-tests | `0` |
69+
| `g:python_highlight_all` | Enable all highlight options above, except for previously set. | `0` |
70+
| `g:python_highlight_file_headers_as_comments` | Highlight shebang and coding headers as comments | `0` |
71+
| `g:python_slow_sync` | Disable for slow machines | `1` |
72+
73+
### Commands
74+
75+
| Command | Description |
76+
| --------------- | ------------------ |
77+
| `Python2Syntax` | Switch to Python 2 |
78+
| `Python3Syntax` | Switch to Python 3 |

README.rst

-110
This file was deleted.

doc/python-syntax.txt

+53-42
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
===============================================================================
44
Introduction *python-syntax* *ft-python-syntax* *python.vim*
55

6-
This is an enhanced version of the original Python syntax highlighting script. Based on
7-
`python.vim` from Vim 6.1 distribution by Neil Schemenauer.
6+
This is an enhanced version of the original Vim 6.1 Python syntax highlighting
7+
`python.vim` by Neil Schemenauer.
88

99
Features
1010
--------
1111

1212
* Added support for Python 3 syntax highlighting
13-
* Added commands `Python2Syntax` and `Python3Syntax` commands which allow to switch
14-
between Python 2 and Python 3 syntaxes respectively without reloads/restarts
13+
* Added commands `Python2Syntax` and `Python3Syntax` allowing to easily switch
14+
between Python 2 and Python 3.
1515
* Updated string highlighting
1616
* Enhanced special symbols highlighting inside strings
1717
* Enhanced highlighting of numeric constants
1818
* Added optional highlighting for %-formatting inside strings
19-
* Added highlighting for magic comments: source code encoding and #! (executable) strings
19+
* Added highlighting for magic comments: source code encoding and
20+
shebangs (`#!`)
2021
* Added highlighting for new exceptions and builtins
2122
* Added highlighting for doctests
2223
* Added highlighting for new `@decorator` syntax introduced in Python 2.4a2
@@ -26,68 +27,78 @@ Features
2627
* Invalid numeric constants
2728
* Invalid %-formatting inside strings
2829
* Invalid variable names
29-
* Trailing spaces (triggered by the `python_highlight_space_errors` option)
30+
* Trailing spaces (Enabled with `g:python_highlight_space_errors`)
3031

31-
Folding is done by the plugin `SimpylFold` (`https://github.com/tmhedberg/SimpylFold`)
32+
Folding is done by the plugin SimpylFold
33+
(https://github.com/tmhedberg/SimpylFold).
3234

3335
===============================================================================
3436
Configuration *python-syntax-configuration*
3537

36-
Enable option with: >
38+
Option variables
39+
----------------
3740

38-
let VARIABLE = 1
39-
<
40-
Disable option with: >
41+
Set variable to `1` to enable or `0` to disable.
4142

42-
let VARIABLE = 0
43-
<
4443
For example to enable all syntax highlighting features you can add the
4544
following command to your `~/.config/nvim/init.vim` or `~/.vimrc`: >
4645

4746
let g:python_highlight_all = 1
4847
<
49-
-------------------------------------------------------------------------------
50-
Select Python version *python-syntax-version*
5148

52-
`g:python_version_2` or `b:python_version_2`
53-
Enable highlighting for Python 2 (Python 3 highlighting is enabled by
54-
default).
49+
`g:python_version_2` (default `0`)
50+
Python 2 mode
5551

56-
Commands to easily switch between modes:
57-
58-
`Python2Syntax`
59-
Switch to Python 2
60-
`Python3Syntax`
61-
Switch to Python 3
52+
`b:python_version_2` (default `0`)
53+
Python 2 mode (buffer local)
6254

63-
-------------------------------------------------------------------------------
64-
Option variables *python-syntax-options* *python-syntax-variables*
55+
`g:python_highlight_builtins` (default `0`)
56+
Highlight builtin functions and objects
6557

66-
`g:python_highlight_builtins`
58+
`g:python_highlight_builtins` (default `0`)
6759
Highlight builtin functions and objects
68-
`g:python_highlight_builtin_objs`
60+
61+
`g:python_highlight_builtin_objs` (default `0`)
6962
Highlight builtin objects only
70-
`g:python_highlight_builtin_funcs`
63+
64+
`g:python_highlight_builtin_funcs` (default `0`)
7165
Highlight builtin functions only
72-
`g:python_highlight_exceptions`
66+
67+
`g:python_highlight_exceptions` (default `0`)
7368
Highlight standard exceptions
74-
`g:python_highlight_string_formatting`
69+
70+
`g:python_highlight_string_formatting` (default `0`)
7571
Highlight `%` string formatting
76-
`g:python_highlight_string_format`
72+
73+
`g:python_highlight_string_format` (default `0`)
7774
Highlight syntax of `str.format` syntax
78-
`g:python_highlight_string_templates`
75+
76+
`g:python_highlight_string_templates` (default `0`)
7977
Highlight syntax of `string.Template`
80-
`g:python_highlight_indent_errors`
78+
79+
`g:python_highlight_indent_errors` (default `0`)
8180
Highlight indentation errors
82-
`g:python_highlight_space_errors`
81+
82+
`g:python_highlight_space_errors` (default `0`)
8383
Highlight trailing spaces
84-
`g:python_highlight_doctests`
84+
85+
`g:python_highlight_doctests` (default `0`)
8586
Highlight doc-tests
86-
`g:python_print_as_function`
87-
Highlight `print` statement as function for Python 2
88-
`g:python_highlight_file_headers_as_comments`
87+
88+
`g:python_highlight_all` (default `0`)
89+
Enable all highlight options above, except for previously set.
90+
91+
`g:python_highlight_file_headers_as_comments` (default `0`)
8992
Highlight shebang and coding headers as comments
90-
`g:python_highlight_all`
91-
Enable all the options above - NOTE: Doesn't override any previously set options
92-
`g:python_slow_sync`
93+
94+
`g:python_slow_sync` (default `1`)
9395
Disable for slow machines
96+
97+
Commands
98+
--------
99+
100+
`Python2Syntax`
101+
Switch to Python 2
102+
103+
`Python3Syntax`
104+
Switch to Python 3

0 commit comments

Comments
 (0)