日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

gvim支持python3编译,解决omnicppcomplete中python3complete报错:requried vim complied with +python3

發(fā)布時(shí)間:2024/3/24 python 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 gvim支持python3编译,解决omnicppcomplete中python3complete报错:requried vim complied with +python3 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

軟件版本:

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. , 便會(huì)報(bào)錯(cuò)requried vim complied with +python3

原因分析:

控制臺(tái)輸入gvim --version,可以看到-python,-python3。 -號(hào)表示不支持,+號(hào)表示支持。 原因是gvim8以后版本,安裝包默認(rèn)不支持python。 所以通過gvim源碼編譯生成gvim.exe時(shí)需要增加Python支持。

解決方案:

1、首先從官網(wǎng)(http://www.vim.org)下載vim82src源碼,以及下載gvim82.exe安裝包。 2、安裝gvim82.exe,然后控制臺(tái)輸入gvim --version,可見-python3。 3、windows下需要安裝mingw-w64(gcc編譯環(huán)境),控制臺(tái)輸入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(注意刪除#號(hào))。 (2)控制臺(tái)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、控制臺(tái)輸入gvim --version,可以看到+python3。 8、打開hello.py,在輸入sys.,即可實(shí)現(xiàn)自動(dòng)補(bǔ)全。

如果要支持python2及其他語言的話,可以參考INSTALLpc.txt。
接下來,開始enjoy coding with vim!

總結(jié)

以上是生活随笔為你收集整理的gvim支持python3编译,解决omnicppcomplete中python3complete报错:requried vim complied with +python3的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。