- Install pyflakes
- Copy the file
ftplugin/python_pyflakes.vim
to your~/.vim/ftplugin
directory
- Open a Python file
- Press
<F7>
to runpyflakes
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].
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>
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!):
autocmd BufWritePost *.py call Pyflakes()
This plugin goes well together with the following plugins: