Ⅰ. 插件描述
Vim plugin: a smarter :tag for Python projectsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mgedmin/pytag-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mgedmin/pytag-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mgedmin/pytag-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mgedmin/pytag.vim
Ⅳ. 文档说明
Overview
This plugins provides a smarter :tag command for Python projects.
Usage::
:Tag name -- jump to a global function
:Tag class.name -- jump to the right class method
:Tag module.class.name -- jump to the right class method
:Tag module.class -- jump to the right class
:Tag package.module.class -- jump to the right class
:Tag package.module -- jump to the right file
:Tag package -- jump to the right file
You still need a tags file. What :Tag does is filter the tags according
to containing class/filename.
If you want to jump to Python modules and packages, you'll need to generate
your tags file with the ctags option --extra=+f.
Installation
You need Vim with +python or +python3.
I recommend a plugin manager like Vundle_ or Pathogen_. E.g. with Vundle
you can ::
:PluginInstall mgedmin/pytag.vim
Manual installation:
- copy plugin/smart-tag.vim to ~/.vim/plugin/
- copy pythonx/smart_tag.py to ~/.vim/pythonx/
.. _Vundle: https://github.com/gmarik/vundle
.. _Pathogen: https://github.com/tpope/vim-pathogen