Build a GVim-based Python development environment on a Windows 10, 64-bit PC. In Part 1, we will install the necessary environment. The Windows account name is daizu, and each program is mainly placed under C: \ Users \ daizu \ AppData \ Local.
Python
Anyway, Python. On Windows, it is convenient to build a Python environment with Anaconda. This time we will use Miniconda to install only the minimum packages. Select Windows / Python 3.5 / 64-bit on the Miniconda page and download it.
To select the installation target, select Just for me and change the Destination folder from the default setting C: \ Users \ daizu \ Miniconda3 to C: \ Users \ daizu \ AppData \ Local \ Miniconda3. Check both Advanced Options. In addition to the default settings, the directory where the executable file is located is added to PATH.
MinGW-w64 - for 32 and 64 bit Windows Prepare the compilation environment. Download and execute the exe file from the Download page of MinGW-w64 to install it. In the dialog in the middle, make the following selections.
Also, change the Destination folder to C: \ Users \ daizu \ AppData \ Local \ mingw-w64. Finally, in the environment variable settings of the control panel, add C: \ Users \ daizu \ AppData \ Local \ mingw-w64 \ mingw64 \ bin to PATH.
Reference URL
http://www.geocities.jp/penguinitis2002/computer/programming/MinGW-w64.html
MSYS2
Install the executable files. Access MSYS2, download msys2-x86_64-xxxxxxxx.exe (xxxx is the date), and execute it. Specify C: \ Users \ daizu \ AppData \ Local \ msys64 for the installation folder. Finally, add C: \ Users \ daizu \ AppData \ Local \ msys64 \ usr \ bin to PATH in the environment variable settings of the control panel.
Install the tar command you will need later. Open a command prompt and under C: \ Users \ daizu \ AppData \ Local \ msys64
$ msys2_shell
Then the shell will change to that of msys2. Under a strange shell
$ update-core
$ pacman -S tar
Install tar as.
Reference URL
http://www.geocities.jp/penguinitis2002/computer/programming/MinGW-w64.html
Git
Download and install from git for windows. Select Use Git from the Windows Command Prompt in Adjusting your PATH enviroment on the way. Leave the others at their defaults.
Lua
Download the source from the Lua download page. Open a command prompt
$ cd Downloads
$ tar zxf lua-5.3.2.tar.gz
And expand. Since it cannot be compiled with the Makefile as it is, obtain the Makefile for mingw64 from the git repository described in the reference URL below.
$ git clone https://github.com/akaneko3/Lua-makefile
$ cd lua-5.3.2
$ cp Makefile Makefile.bak
$ cp ..\Lua-makefile\Makefile .
Open the Makefile with an editor and change the location where the Lua version is set to 5.3.2. continue
$ mingw32-make  mingw
Compile with. After that, I tried to copy each file with $ mingw32-make install, but I could not execute it well, so I moved it manually based on the description of Makefile. Create the Lua execution directory C: \ Users \ daizu \ AppData \ Local \ lua-5.3.2 \, and create additional bin, ʻinclude, and lib` subdirectories under it. Makefile
TO_BIN= lua.exe luac.exe
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp  
TO_LIB= liblua.a
As there is, copy the corresponding file from C: \ Users \ daizu \ Downloads \ lua-5.3.2 \ src (*). Finally, add C: \ Users \ daizu \ AppData \ Local \ lua-5.3.2 \ bin to PATH in the environment variable settings of the control panel.
(*) [2016/02/28 postscript] In addition to lua.exe and luac.exe, it is necessary to copy lua53.dll from the src directory to the bin directory.
Reference URL
http://qiita.com/akaneko3/items/c63b9d6589732388bebb
GVim
Get the source from GitHub. Open a command prompt
$ cd AppData\Local
$ git clone https://github.com/vim/vim.git
$ cd git
$ git checkout v7.4.1161
will do. The last line is the latest Vim version of Kaoriya-san (2016/01/24 version It was executed to match 01/24 /)).
Download the batch file makevim64.bat for compiling from the reference URL below and copy it to C: \ Users \ daizu \ AppData \ Local \ vim. Edit makevim64.bat as follows to match the Lua and Python versions.
makevim64.bat
setlocal
:: path to MinGw64
set USERNAME=daizu
set USERDOMAIN=
set PYTHON3=C:/Users/daizu/AppData/Local/Miniconda3
set PYTHON3_VER=35
set DYNAMIC_PYTHON3=yes
set LUA=C:/Users/daizu/AppData/Local/lua-5.3.2
set LUA_VER=53
set DYNAMIC_LUA=yes
md bin
cd src
:: Clean
mingw32-make -f Make_ming.mak GUI=yes clean ARCH=x86-64
:: GUI x64
mingw32-make -f Make_ming.mak GUI=yes OLE=no FEATURES=HUGE ARCH=x86-64
set OUTDIR=../bin
copy *.exe "%OUTDIR%"
copy .\GvimExt\*.dll "%OUTDIR%"
copy *.dll "%OUTDIR%"
copy .\xxd\*.exe "%OUTDIR%"
cd ..
endlocal
At the command prompt, go to C: \ Users \ daizu \ AppData \ Local \ vim and go to
$ makevim64.bat
Compile as.
If the compilation is successful, create a vim74-daizu folder in C: \ Users \ daizu \ AppData \ Local, and create a vim74 directory under it. Copy the directory and set of files in runtime under vim74 under the directory where you compiled vim (C: \ Users \ daizu \ AppData \ Local \ vim). Then compile the compiled executables gvim.exe and vimrun.exe from C: \ Users \ daizu \ AppData \ Local \ vim \ src toC: \ Users \ daizu \ AppData \ Local \ vim74-daizu Copy to. Then, get ʻiconv.dllandlibintl.dll for 64-bit from the reference URL, and copy them under the vim74-daizudirectory as well. Also, addC: \ Users \ daizu \ AppData \ Local \ vim74-daizu` to your PATH. Now you can run GVim.
For the GVim configuration file, create the vimfiles directory under C: \ Users \ daizu \ AppData \ Local \ vim74-daizu and prepare it in it. This time, I want to use this as a Git repository, so in C: \ Users \ daizu \ AppData \ Local \ vim74-daizu,
$ git init vimfiles
will do. Create _vimrc and _gvimrc in vimfiles. The following is an example only for checking the operation.
_vimrc
 set enc=utf-8
_gvimrc
 colorscheme desert
Link these to your home directory. Open a command prompt with administrator privileges
$ mklink c:\Users\daizu\_vimrc c:\Users\daizu\AppData\Local\vim74-daizu\vimfiles\_vimrc
$ mklink c:\Users\daizu\_gvimrc c:\Users\daizu\AppData\Local\vim74-daizu\vimfiles\_gvimrc
will do.
Reference URL
https://sites.google.com/site/fudist/Home/vim-nihongo-ban/mingwvim
Neobundle
Use Neobundle to manage Vim plugins. Under C: \ Users \ daizu
$ mkdir -p .vim\bundle
$ cd .vim\bundle
$ git clone https://github.com/Shougo/neobundle.vim
will do. For _vimrc, refer to the URL below.
Reference URL
http://qiita.com/poad1010/items/de16d9a1af78687c87cf
As a result of the installation work so far, the environment variables of the user are as shown in the figure below.

Git couldn't choose the installation destination, so it's unavoidably included under Program Files (x86).
vimproc
Although the explanation is omitted this time, you can compile vimproc with the following command.
$ cd ~\.vim\bundle\vimproc
$ mingw32-make
Reference URL
http://qiita.com/akase244/items/ce5e2e18ad5883e98a77
IPAfont
IPA Gothic looks great with GVim's multibyte fonts. Download from the URL below and install the font.
http://ipafont.ipa.go.jp/old/ipafont/download.html
Install packages that help you code Python.
$ conda install jedi flake8 pytest nose
$ pip install autopep8
Since Vim makes heavy use of the Ctrl key, assign the Ctrl key function to the unused Caps key.
Reference URL
http://ascii.jp/elem/000/000/927/927191/