A better "go to declaration" for Python files in vim
What is this?
pygd-vim replaces vim's built-in
gd command - 'go to declaration' - with an implementation
that uses Python's Abstract Syntax Tree to understand the meaning of the code and go to the
place that the identifier actually was declared.
See my blog for motivation and an explanation.
pygd requires pyflakes, as it builds on that project's AST visitor code. pyflakes is included as a submodule, so will be automatically installed alongside pygd.
The best way of installing pygd is via Vundle. From inside vim, just do:
then add this line to your
Alternatively, you can clone the repo and move
pygd.vim and the
Just place the cursor over an identifier - variable, function or class - and press
you will be moved to the place that that identifier was defined within the current scope.