mirror of
https://github.com/gryf/.vim.git
synced 2025-12-18 12:00:30 +01:00
Update for plugins: pyflakes and pydoc. Added awesome plugin for autocompletion acp.
This commit is contained in:
@@ -1,36 +1,80 @@
|
||||
pyflakes
|
||||
========
|
||||
pyflakes-vim
|
||||
============
|
||||
|
||||
This version of PyFlakes_ has been improved to use Python's newer ``ast``
|
||||
module, instead of ``compiler``. So code checking happens faster, and will stay
|
||||
up to date with new language changes.
|
||||
A Vim plugin for checking Python code on the fly.
|
||||
|
||||
.. _PyFlakes: http://www.divmod.org/trac/wiki/DivmodPyflakes
|
||||
PyFlakes catches common Python errors like mistyping a variable name or
|
||||
accessing a local before it is bound, and also gives warnings for things like
|
||||
unused imports.
|
||||
|
||||
pyflakes-vim uses the output from PyFlakes to highlight errors in your code.
|
||||
To locate errors quickly, use quickfix_ commands like :cc.
|
||||
|
||||
Make sure to check vim.org_ for the latest updates.
|
||||
|
||||
.. _pyflakes.vim: http://www.vim.org/scripts/script.php?script_id=2441
|
||||
.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441
|
||||
.. _quickfix: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix
|
||||
|
||||
Quick Installation
|
||||
------------------
|
||||
|
||||
1. Make sure your ``.vimrc`` has::
|
||||
|
||||
filetype on " enables filetype detection
|
||||
filetype plugin on " enables filetype specific plugins
|
||||
|
||||
2. Download the latest release_.
|
||||
|
||||
3. Unzip ``pyflakes.vim`` and the ``pyflakes`` directory into
|
||||
``~/.vim/ftplugin/python`` (or somewhere similar on your
|
||||
`runtime path`_ that will be sourced for Python files).
|
||||
|
||||
.. _release: http://www.vim.org/scripts/script.php?script_id=2441
|
||||
.. _runtime path: http://vimdoc.sourceforge.net/htmldoc/options.html#'runtimepath'
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
If you downloaded this from vim.org_, then just drop the contents of the zip
|
||||
file into ``~/.vim/ftplugin/python``.
|
||||
|
||||
Otherwise, if you're running "from source," you'll need PyFlakes on your
|
||||
PYTHONPATH somewhere. I recommend getting my PyFlakes_ fork, which retains
|
||||
column number information and has therfore has more specific error locations.
|
||||
|
||||
.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441
|
||||
.. _PyFlakes: http://github.com/kevinw/pyflakes
|
||||
|
||||
Hacking
|
||||
-------
|
||||
|
||||
::
|
||||
|
||||
git clone git://github.com/kevinw/pyflakes-vim.git
|
||||
cd pyflakes-vim
|
||||
git clone git://github.com/kevinw/pyflakes.git
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
Set this option to you vimrc file to disable quickfix support::
|
||||
|
||||
let g:pyflakes_use_quickfix = 0
|
||||
|
||||
The value is set to 1 by default.
|
||||
|
||||
TODO
|
||||
----
|
||||
* signs_ support (show warning and error icons to left of the buffer area)
|
||||
* configuration variables
|
||||
* parse or intercept useful output from the warnings module
|
||||
|
||||
Importing several modules from the same package results in unnecessary warnings:
|
||||
.. _signs: http://www.vim.org/htmldoc/sign.html
|
||||
|
||||
::
|
||||
Changelog
|
||||
---------
|
||||
|
||||
import a.b
|
||||
import a.c # Redefinition of unused "a" from line 1
|
||||
|
||||
The following construct for defining a function differently depending on some
|
||||
condition results in a redefinition warning:
|
||||
|
||||
::
|
||||
|
||||
if some_condition:
|
||||
def foo(): do_foo()
|
||||
else:
|
||||
def foo(): do_bar() # redefinition of function 'foo' from line 2
|
||||
|
||||
IDE Integration
|
||||
---------------
|
||||
|
||||
* vim: pyflakes-vim_
|
||||
|
||||
.. _pyflakes-vim: http://github.com/kevinw/pyflakes-vim
|
||||
Please see http://www.vim.org/scripts/script.php?script_id=2441 for a history of
|
||||
all changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user