Skip to content

Commit cdbcd47

Browse files
author
Kenneth Reitz
committed
Merge pull request realpython#102 from kevinburke/vim
sharpen up vim section and spelling fixes
2 parents 574ab18 + 67d6aa5 commit cdbcd47

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

docs/dev/env.rst

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ however, using a more powerful editor may make your life a bit easier.
1212
VIM
1313
---
1414

15-
16-
There exist a couple of plugins and settings for the VIM editor to aid python
17-
development. If you only develop in Python, a good start is to set the default
18-
settings for indentation and linewrapping to values compliant with PEP8::
15+
Vim is a text editor which uses keyboard shortcuts for editing instead of menus
16+
or icons. There exist a couple of plugins and settings for the VIM editor to
17+
aid python development. If you only develop in Python, a good start is to set
18+
the default settings for indentation and linewrapping to values compliant with
19+
`PEP 8 <http://www.python.org/dev/peps/pep-0008/>`_. In your home directory,
20+
open a file called `.vimrc` and add the following lines: ::
1921

2022
set textwidth=79
2123
set shiftwidth=4
@@ -24,25 +26,26 @@ settings for indentation and linewrapping to values compliant with PEP8::
2426
set softtabstop=4
2527
set shiftround
2628

27-
With these settings newlines are inserted after 79 characters and indentation
29+
With these settings, newlines are inserted after 79 characters and indentation
2830
is set to 4 spaces per tab. If you also use VIM for other languages, there is a
2931
handy plugin at indent_, which handles indentation settings for python source
3032
files.
31-
Additionally there is also a handy syntax plugin at syntax_ featuring some
32-
improvements over the syntax file included in VIM 6.1.
33+
34+
There is also a handy syntax plugin at syntax_ featuring some improvements over
35+
the syntax file included in VIM 6.1.
3336

3437
These plugins supply you with a basic environment for developing in Python.
35-
However in order to improve the programming flow we also want to continually
36-
check for PEP8 compliance and check syntax. Luckily there exist PEP8_ and
37-
Pyflakes_ to do this for you. If your VIM is compiled with `+python` you can
38-
also utilize some very handy plugins to do these checks from within the editor.
39-
For PEP8 checking install vim-pep8_. Now you can map the vim function
40-
`Pep8()` to any hotkey or action you want. Similarly for pyflakes you can
41-
install vim-pyflakes_. Now you can map `Pyflakes()` like the PEP8 function and
42-
have it called quickly. Both plugins will display errors in a quickfix list and
43-
provide an easy way to jump to the corresponding line. A very handy setting is
44-
calling these functions whenever a buffer is saved. In order to do this, enter
45-
the following lines into your vimrc::
38+
To get the most out of Vim, you should continually check your code for syntax
39+
errors and PEP8 compliance. Luckily PEP8_ and Pyflakes_ will do this for you.
40+
If your VIM is compiled with `+python` you can also utilize some very handy
41+
plugins to do these checks from within the editor.
42+
43+
For PEP8 checking, install the vim-pep8_ plugin, and for pyflakes you can
44+
install vim-pyflakes_. Now you can map the functions `Pep8()` or `Pyflakes()`
45+
to any hotkey or action you want in Vim. Both plugins will display errors at
46+
the bottom of the screen, and provide an easy way to jump to the corresponding
47+
line. It's very handy to call these functions whenever you save a file. In
48+
order to do this, add the following lines to your `vimrc`::
4649

4750
autocmd BufWritePost *.py call Pyflakes()
4851
autocmd BufWritePost *.py call Pep8()
@@ -92,7 +95,7 @@ The most popular Eclipse plugin for Python development is Aptana's
9295

9396
Komodo IDE
9497
-----------
95-
`Komodo IDE <http://www.activestate.com/komodo-ide>`_ is developed by ActiveState and is a commerical IDE for Windows, Mac
98+
`Komodo IDE <http://www.activestate.com/komodo-ide>`_ is developed by ActiveState and is a commercial IDE for Windows, Mac
9699
and Linux.
97100

98101

@@ -109,7 +112,7 @@ Spyder is open-source (free), offers code completion, syntax highlighting, class
109112
WingIDE
110113
-------
111114

112-
`WingIDE <http://wingware.com/>`_ a python specific IDE. Runs for Linux, Windows, and Mac (as on X11 application, which frustrates some Mac users).
115+
`WingIDE <http://wingware.com/>`_ a python specific IDE. Runs for Linux, Windows, and Mac (as an X11 application, which frustrates some Mac users).
113116

114117

115118
Interpreter Tools

docs/writing/documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Documenting Your Code
22
=====================
33

4-
Documenting your code is extremely important. It is debatebly even
4+
Documenting your code is extremely important. It is debatably even
55
more important than testing.
66

77

0 commit comments

Comments
 (0)