Vim Installation
Install gVim on Windows platform
Download the source code from official website (link)
Here is the ftp address for vim 9.0 version (link: vim-9.0.tar.bz2)
Decompress the tar ball file, go to
vim90\srcfolderRead file
INSTALLpc.txtfileMake sure current Windows OS is 64-bit, make sure the python installed is for 64-bit.
In MSYS2 terminal, use 64-bit version of make to build
$ pwd /e/temp/vim90src/vim90/src $ make -f Make_ming.mak PYTHON3=D:/procs/python38 DYNAMIC_PYTHON3=yes PYTHON3_VER=38
output message
... ... D:/procs/msys64/mingw64/bin/make.exe -C GvimExt -f Make_ming.mak CROSS=no CROSS_COMPILE= CXX='g++' STATIC_STDCPLUS=no make[1]: Entering directory 'E:/temp/vim90src/vim90/src/GvimExt' g++ -O2 -DFEAT_GETTEXT -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -c gvimext.cpp -o gvimext.o windres --input-format=rc --output-format=coff -DMING gvimext_ming.rc -o gvimext.res g++ -shared -O2 -s -o gvimext.dll \ -Wl,--enable-auto-image-base \ -Wl,--enable-auto-import \ -Wl,--whole-archive \ gvimext.o gvimext.res gvimext_ming.def \ -Wl,--no-whole-archive \ -luuid -lgdi32 make[1]: Leaving directory 'E:/temp/vim90src/vim90/src/GvimExt'
After build complete,
gvim.exewill be created in currentsrcfolderRemember to set environment variables,
PYTHONHOME=D:\procs\python38 PYTHONPATH=D:\procs\python38 PYTHON38=D:\procs\python38
and append the the following to
PATHvariable,%PYTHONHOME% %PYTHON38%\Scripts\ %PYTHON38%\
或者可以不用把新版本的python加到
PATH环境变量中去,但是要在$VIM\_vimr中添加对应的变量设置,否则同样地:echo has("python3")永远返回0" ------------------------------------------------------ " Python3 support " ------------------------------------------------------ function s:setup_python3_dyn() let &pythonthreedll='D:/procs/python38/python38.dll' let &pythonthreehome='D:/procs/python38 endfunction " End of function setup_python3_dyn """ ------------------------------------------------------ """ Setup for the coc-nvim """ ------------------------------------------------------ function s:setup_python3() let g:python3_host_prog='D:/procs/python38/python.exe' endfunction
After setting environment variables, check if the python3 is support in Vim
:echo has("python3")
Now it should return
1, which means python3 is supported.Re-visit file
INSTALLpc.txtfile to check how to add support for Lua, Ruby, Tcl and others.In order to use
plug.vim, download it and put it in folderD:\procs\Vim9Compiled\vim90\runtime\autoload, otherwise it can’t be found.