Answer the question
In order to leave comments, you need to log in
How to make vim+python-mode+{jedi-vim} bundle work with Python3?
Salute to the Lord!
We have:
1. OS Gentoo Linux 3.18.11-gentoo x86_64
2. app-editors/vim
USE="X acl gpm nls python"
PYTHON_SINGLE_TARGET="python2_7"
PYTHON_TARGETS="python2_7 python3_3"
3. app-vim/python-mode
4 .vimrc:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle.vim
call vundle#begin()
Plugin 'gmarik/vundle.vim'
Plugin 'tomasr/molokai'
Plugin 'scrooloose/nerdtree'
Plugin 'AutoClose'
Plugin 'bling/vim-airline'
Plugin 'davidhalter/jedi-vim'
call vundle#end() " required
filetype plugin indent on
set t_Co=256
set cursorline
set nocompatible
set wrap
set linebreak
set showcmd
set ruler
set confirm
set smartindent
set autoindent
set tabstop=4
set shiftwidth=4
"set list
set cursorline
set wildmenu
set wcm=<TAB>
colorscheme molokai
set guifont=Dejavu\ Sans\ Mono\ Book\ 10
set laststatus=2
"----------------- Py-Mode -----------------------------"
let g:pymode_python = 'python3'
let g:pymode_rope = 0
let g:pymode_rope_completion = 0
let g:pymode_rope_complete_on_dot = 0
"----------------- Jedi ----------------------------------"
let g:jedi#force_py_version = 3
print "somth"
instead print("somth")
of , and on import only lists modules installed in Py2. import sys
for i in sys.path: print(i)
/usr/share/vim/vimfiles/pylibs
/usr/lib64/python27.zip
/usr/lib64/python2.7
/usr/lib64/python2.7/plat-linux2
/usr/lib64/python2.7/lib-tk
/usr/lib64/python2.7/lib-old
/usr/lib64/python2.7/lib-dynload
/usr/lib64/python2.7/site-packages
Answer the question
In order to leave comments, you need to log in
First, you need to decide which of these two plugins outputs this autocomplete, because. jedi-vim conflicts with python-mode in many cases, as stated in the documentation . Sometimes this manifests itself in the wild brakes of the autocomplete, and sometimes in the autocomplete itself.
Secondly, for jedi-vim to work correctly with Python 3, you need Vim with +python3, because in his work he uses "py3file" and "python3" commands. You can verify python3 support via vim --version, or by calling :python3 in the editor itself.
Thirdly, for comfortable work, it is best to run Vim from the appropriate virtual environment with the required version of the Python interpreter, because the same pylama (either as an external plugin or from the python-mode package), if Vim is built with +python and +python3 at the same time, in some situations it can produce a very interesting linting output.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question