vim-gf-python


Ⅰ. 插件描述

Plugin to enhance support for vim's 'gf' map in python.

Ⅱ. 基本信息

创建日期:  2011-08-22
使用用户:  9
Github星:  15
插件作者:  Michael Komitee

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Goto File for Python

This is a simple utility to improve vim's standard goto file gf mapping in python. It can find most things, but not all.

It iterates through python's sys.path and looks for modules where one would typically expect to find them.

For example:

  • gf on os finds os.py.
  • gf on email.base64mime finds email/base64mime.py.
  • gf on sqlite3 finds sqlite3/__init__.py.

It does not find more complicated relationships like os.path.

I have a solution to find things like os.path, but the implementation could be considered unsafe. It would involve attempting to import it, and so depending on what one tries to find, it could be dangerous as the code would in effect be evaluated.

添加新评论