Ⅰ. 插件描述
a gf tweak for python webapp developersⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mjbrownie/getfileplus'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mjbrownie/getfileplus'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mjbrownie/getfileplus'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/GetFilePlus
Ⅳ. 文档说明
Usage: place plugin/gf.vim in your ~/.vim/plugin directory
Repo: https://github.com/mjbrownie/GetFilePlus
GetFilePlus is a simple enhancement on the gf mappings it does the following
- standard 'find file/path.ext' first as normal gf would.
- does a 'find ./file/path.ext'. check
This is for when a file path starts with a / (often js and css references).
eg: /js/some_file.js that actually resides in media/js/some_file.js
Note for this to be useful you need to set up your :set path to refer to
the directories you want. (Eg. I have :set path+=media/ in my .vimrc) - does a python path check eg.
from django.contrib.admin.views import foobar
would open /yourvirtualenv/lib/site-packages/django/contrib/admin/views.py
Note for this to work you need the python path to set eg in your .vimrc
python import sys;sys.path = sys.path + ['yourvirtualenv/lib/site-packages/']
Also as a bonus There is a command included to make it easier to open python
files from the command line.
:Ppath django.contrib.admin.views<cr>
would open /yourvirtualenv/lib/site-packages/django/contrib/admin/views.py
Note as is the script will send any import errors to screen. If this is the
case then it's just sys.path not configured properly
This script needs vim python support