栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在vim中设置python virtualenv

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在vim中设置python virtualenv

这是我使用的(很抱歉,突出显示的内容很奇怪)。

" Function to activate a virtualenv in the embedded interpreter for" omnicomplete and other things like that.function LoadVirtualEnv(path)    let activate_this = a:path . '/bin/activate_this.py'    if getftype(a:path) == "dir" && filereadable(activate_this)        python << EOFimport vimactivate_this = vim.eval('l:activate_this')execfile(activate_this, dict(__file__=activate_this))EOF    endifendfunction" Load up a 'stable' virtualenv if one exists in ~/.virtualenvlet defaultvirtualenv = $HOME . "/.virtualenvs/stable"" only attempt to load this virtualenv if the defaultvirtualenv" actually exists, and we aren't running with a virtualenv active.if has("python")    if empty($VIRTUAL_ENV) && getftype(defaultvirtualenv) == "dir"        call LoadVirtualEnv(defaultvirtualenv)    endifendif

请注意,您需要针对用于virtualenv的Python编译MacVim,例如,如果您从Python.org下载了Python
2.7,则应使用

--with-python-config-dir=/Library/frameworks/Python.framework/Versions/2.7/lib/python2.7/config
作为参数重新编译MacVim
./configure


希望有帮助!

编辑: 只需注明 出处:
写这个小东西的许多侦探工作都是由这个博客完成的,他应该得到一些荣誉。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/660625.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号