]> git.madduck.net Git - etc/vim.git/blob - README.mdown

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

99ef175da759223f5c3c0eb06d68dda1261ba106
[etc/vim.git] / README.mdown
1 vim-flake8
2 ==========
3 `vim-flake8` is a Vim plugin that runs the currently open file through Flake8,
4 a static syntax and style checker for Python source code.  It supersedes both
5 [vim-pyflakes](https://github.com/nvie/vim-pyflakes) and
6 [vim-pep8](https://github.com/nvie/vim-pep8).
7
8 Flake8 is a wrapper around PyFlakes (static syntax checker), PEP8 (style
9 checker) and Ned's MacCabe script (complexity checker).
10
11
12 Installation
13 ------------
14 Use [vim-pathogen](https://github.com/tpope/vim-pathogen) if you're not using
15 it already.  Then, simply put the contents of this repository in your
16 `~/.vim/bundle` directory.
17
18 Usage
19 -----
20 1. Open a Python file
21 2. Press `<F7>` to run `flake8` on it
22
23 It shows the errors inside a quickfix window, which will allow your to quickly
24 jump to the error locations by simply pressing [Enter].
25
26
27 Customization
28 -------------
29 If you don't want to use the `<F7>` key for flake8-checking, simply remap it to
30 another key.  It autodetects whether it has been remapped and won't register
31 the `<F7>` key if so.  For example, to remap it to `<F3>` instead, use:
32
33     autocmd FileType python map <buffer> <F3> :call Flake8()<CR>
34
35
36 Tips
37 ----
38 A tip might be to run the Flake8 check every time you write a Python file, to
39 enable this, add the following line to your `.vimrc` file (thanks
40 [Godefroid](http://github.com/gotcha)!):
41
42     autocmd BufWritePost *.py call Flake8()
43
44 To ignore errors, in your .vimrc:
45
46     let g:flake8_ignore="E501,W293"
47
48 If you want to cutomize the location of your flake8 binary, set `g:flake8_cmd`:
49
50     let g:flake8_cmd="/opt/strangebin/flake8000"
51
52 This plugin goes well together with the following plugin:
53
54 - [PyUnit](http://github.com/nvie/vim-pyunit) (unit test helper under `<F8>`
55   and `<F9>`)