Ⅰ. 插件描述
Activate python virtualenv within VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'lambdalisue/vim-python-virtualenv'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'lambdalisue/vim-python-virtualenv'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'lambdalisue/vim-python-virtualenv'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/lambdalisue/vim-python-virtualenv
Ⅳ. 文档说明
vim-python-virtualenv
This plugin is for using virtualenv <http://pypi.python.org/pypi/virtualenv>_ within Vim.
It activate the virtualenv and add the path to sys.path
Also this plugin save virtualenv name to pythonworkon variable of vim.
Required
Vim compiled with +python
How to install
Using vundle <https://github.com/gmarik/vundle> or pathogen <http://www.vim.org/scripts/script.php?script_id=2332> is recommended or simply extract to your vim directory
Usage
This plugin save virtualenv name to pythonworkon variable of vim so if you want to check the name of virtualenv in status line, add the following code to your .vimrc::
" Apply g:pythonworkon to statusline
let &statusline='%F%m%r%h%w [FORMAT=%{&ff}] [ENC=%{&fileencoding}] [TYPE=%Y] [ASCII=\%03.3b] [HEX=\%02.2B] [POS=%04l,%04v][%p%%] [LEN=%L] %= [WORKON=%{pythonworkon}]'
And you will see something like below
.. Image:: http://hashnote.net/storage/5/preview/