pymode python3

Try adding this to your .vimrc file

let g:pymode_python = 'python3' I found this in the help docs. In vim type:

:help python-mode By default, vim is not compiled with python3 support, so when I tried this, I got all kinds of errors... Which tells me it's trying to use python3. But if your vim --version output shows +python3 you should be good.

EDIT: By default, Ubuntu 14.04 doesn't come with +python3 support. And due to limitations, you can't have both python2 and python3 support.

So, you have to compile vim with python3 support.

These are the steps that worked for me: From a linux command line:

Install packages

sudo apt-get install checkinstall mercurial python-dev python3-dev ruby ruby-dev libx11-dev libxt-dev libgtk2.0-dev libncurses5 ncurses-dev Grab the latest version of vim

hg clone https://vim.googlecode.com/hg/ vim Configure it

cd vim ./configure
--enable-perlinterp
--enable-python3interp
--enable-rubyinterp
--enable-cscope
--enable-gui=auto
--enable-gtk2-check
--enable-gnome-check
--with-features=huge
--enable-multibyte
--with-x
--with-compiledby="xorpd"
--with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu
--prefix=/opt/vim74 Compile it

make Test it

make test Install it

sudo checkinstall Link the package

sudo ln -s /opt/vim74/bin/vim /usr/bin/vim-py3 Now, you have both versions of vim

To use normal vim (python2) type vim file.py

To use vim with python3 support type vim-py3 file.py

If you just want the python3 version, then you only need to link it to the new vim

ln -s /opt/vim74/bin/vim /usr/local/bin/vim And if you want to switch back to the python2 version, remove the link

rm /usr/local/bin/vim

转载于:https://my.oschina.net/dormouse/blog/824354

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值