python_showpydoc.vim


Ⅰ. 插件描述

Show document string of python3 or later in command line~

Ⅱ. 基本信息

创建日期:  2010-08-17
使用用户:  1
Github星:  1
插件作者:  Reaper Des

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/python-showpydoc-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/python-showpydoc-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/python-showpydoc-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/python_showpydoc.vim

Ⅳ. 文档说明

The script has updated for support both python2.x and python3.x
go to vimscript#3212 for new version.  
Note: this plugin needs python3/dyn so that using gvim7.3 is easist and best way.

usage:         commands:
                 :Spydoc object
                 the "object" can be an "imported" class, module or function(/method)
                 the command return document string corresponding to the object.
                 else return type of the object.
                 if the object is "unimported" the command will fail except for
                 modules re, vim and
                 FunctionType, MethodType, ModuleType, BuiltinFunctionType,
                 BuiltinMethodType imported from module types

tip:             this plugin now is just designed for standart python3 library,
                 if try the command with a user-defined "object",
                 be very likely to get an error "name 'object' is not defined".

examples:  lets say a simple python script:
                   import sys;
                   form sys import path;
                   class Test(object): pass;
                   t = Test();
                and input following commands:

                :Spydoc sys
                sys document(module)

                :Spydoc sys.exit
                sys.exit document(function)

                :Spydoc sys.path
                type of sys.path(built-in type list)

                :Spydoc path
                type of os.path(same as above)

                :Spydoc Test:
                error: name 'Test' is not define

                :Spydoc t:
                error: name 't' is not define

                :Spydoc sys.ss
                error: 'module' object has no attribute 'ss'

                :Spydoc sys.exit()
                error: 'sys.exit()' is a wrong?

添加新评论