mirror of
https://github.com/kennethreitz-archive/krvim.git
synced 2026-06-05 23:40:18 +00:00
39 lines
1.2 KiB
Markdown
39 lines
1.2 KiB
Markdown
Installation
|
|
------------
|
|
1. Install [pyflakes](http://pypi.python.org/pypi/pyflakes/)
|
|
2. Copy the file `ftplugin/python_pyflakes.vim` to your `~/.vim/ftplugin` directory
|
|
|
|
|
|
Usage
|
|
-----
|
|
1. Open a Python file
|
|
2. Press `<F7>` to run `pyflakes` on it
|
|
|
|
It shows the errors inside a quickfix window, which will allow your to quickly
|
|
jump to the error locations by simply pressing [Enter].
|
|
|
|
|
|
Customization
|
|
-------------
|
|
If you don't want to use the `<F7>` key for pyflakes-checking, simply remap it to
|
|
another key. It autodetects whether it has been remapped and won't register
|
|
the `<F7>` key if so. For example, to remap it to `<F3>` instead, use:
|
|
|
|
autocmd FileType python map <buffer> <F3> :call Pyflakes()<CR>
|
|
|
|
|
|
Tips
|
|
----
|
|
A tip might be to run the Pyflakes check every time you write a Python file, to
|
|
enable this, add the following line to your `.vimrc` file (thanks
|
|
[Godefroid](http://github.com/gotcha)!):
|
|
|
|
autocmd BufWritePost *.py call Pyflakes()
|
|
|
|
|
|
This plugin goes well together with the following plugins:
|
|
|
|
- [PEP8](http://github.com/nvie/vim-pep8) (Python coding style checker under `<F6>`)
|
|
- [PyUnit](http://github.com/nvie/vim-pyunit) (unit test helper under `<F8>`
|
|
and `<F9>`)
|