Ⅰ. 插件描述
:athletic_shoe: Quickly open Python modules in vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'sloria/vim-ped'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'sloria/vim-ped'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'sloria/vim-ped'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/sloria/vim-ped
Ⅳ. 文档说明
# ped.vim
Quickly open Python modules based on Python import paths.
This is particularly useful for viewing/editing third-party packages in a virtual environment.
Quickstart
:Ped <path.to.module>Examples
:Ped django.shortcuts
:Ped django.views.generic.TemplateView
" Partial matches work, too
:Ped django.views.generic.TemplInstallation
Requires the ped Python package (installable with pip).
$ pip install -U pedThen add this plugin using your favorite plugin manager.
Using vim-plug:
" ~/.vimrc
Plug 'sloria/vim-ped'Defining mappings
<Plug>PedPrompt: Shortcut to input:Pedin the command line.<Plug>PedVword: Input:Ped pkgin the command line, where "pkg" is the current visual selection.<Plug>PedVwordExec: Like<Plug>PedVword, but executes immediately.<Plug>PedCword: Input:Ped pkgin the command line, where "pkg" is the current word under the cursor.<Plug>PedCwordExec: Like<Plug>PedCword, but executes immediately.
Example mappings
nmap <leader>e <Plug>PedPrompt
nmap <leader>E <Plug>PedCwordExec
vmap <leader>e <Plug>PedVwordExecConfiguration
" Vim command to open files, defaults to 'edit'
" Examples: 'tabedit', 'split', 'vsplit'
let g:ped_edit_command = 'edit'
" ped executable, defaults to 'ped'
let g:ped_executable = 'ped'