Ⅰ. 插件描述
A better "go to declaration" for Python files in vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'danielroseman/pygd-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'danielroseman/pygd-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'danielroseman/pygd-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/danielroseman/pygd-vim
Ⅳ. 文档说明
pygd-vim
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.
Installation
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:
:BundleInstall 'danielroseman/pygd-vim'
then add this line to your .vimrc:
Bundle 'danielroseman/pygd-vim'
Alternatively, you can clone the repo and move pygd.vim and the pyflakes subdirectory
into your ftplugin/python directory.
Usage
Just place the cursor over an identifier - variable, function or class - and press gd, and
you will be moved to the place that that identifier was defined within the current scope.