gvim支持python3编译,解决omnicppcomplete中python3complete报错:requried vim complied with +python3
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                gvim支持python3编译,解决omnicppcomplete中python3complete报错:requried vim complied with +python3
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
                                軟件版本:
gvim82,python3.6,mingw-w64(gcc 8.1)問題描述:
1、在_vimrc文件中添加: autocmd Filetype python set omnifunc=python3complete#Complete autocmd Filetype python inoremap <buffer>. .<C-X><C-O> 2、編輯hello.py文件,輸入 sys. , 便會報錯requried vim complied with +python3原因分析:
控制臺輸入gvim --version,可以看到-python,-python3。 -號表示不支持,+號表示支持。 原因是gvim8以后版本,安裝包默認(rèn)不支持python。 所以通過gvim源碼編譯生成gvim.exe時需要增加Python支持。解決方案:
1、首先從官網(wǎng)(http://www.vim.org)下載vim82src源碼,以及下載gvim82.exe安裝包。 2、安裝gvim82.exe,然后控制臺輸入gvim --version,可見-python3。 3、windows下需要安裝mingw-w64(gcc編譯環(huán)境),控制臺輸入mingw32-make --version保證安裝成功。 4、源碼vim82src/vim/vim82/src/INSTALLpc.txt,詳細(xì)介紹了編譯過程: ================================ Building with Python3 supportFor building with MSVC the "Windows Installer" from www.python.org works fine. Python 3.6 is recommended.When building, you need to set the following variables at least:PYTHON3: Where Python3 is installed. E.g. C:\Python36DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.When using MinGW and link with the official Python3 (as one line):mingw32-make -f Make_ming.makPYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 ================================ 5、以下介紹我的編譯過程: (1)修改vim82src/vim/vim82/src/Make_cyg_ming.mak文件,查找ARCH,將其設(shè)置為ARCH=x86-64(注意刪除#號)。 (2)控制臺cd到vim82src/vim/vim82/src文件夾,然后執(zhí)行: mingw32-make -f Make_ming.mak PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 gvim.exe 需注意python的安裝路徑要修改。 6、將gvim.exe拷貝到vim82安裝路徑中,替換原有的。 7、控制臺輸入gvim --version,可以看到+python3。 8、打開hello.py,在輸入sys.,即可實現(xiàn)自動補全。如果要支持python2及其他語言的話,可以參考INSTALLpc.txt。
 接下來,開始enjoy coding with vim!
總結(jié)
以上是生活随笔為你收集整理的gvim支持python3编译,解决omnicppcomplete中python3complete报错:requried vim complied with +python3的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 基于Bert的图书分类项目
- 下一篇: 解决问题:远程电脑时出现发生身份验证错误
