Build a GVim-based Python development environment on Windows 10 (1) Installation

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

Finally

As a result of the installation work so far, the environment variables of the user are as shown in the figure below.

path.png

Git couldn't choose the installation destination, so it's unavoidably included under Program Files (x86).

Other

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

Python package

Install packages that help you code Python.

$ conda install jedi flake8 pytest nose
$ pip install autopep8

Use Caps key as Ctrl key

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/

Recommended Posts

Build a GVim-based Python development environment on Windows 10 (1) Installation
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Build Python environment on Windows
Build python environment on windows
Simply build a Python 3 execution environment on Windows
Build a Python development environment on your Mac
Create a Python virtual development environment on Windows
Build a Python development environment on Raspberry Pi
Create a comfortable Python 3 (Anaconda) development environment on windows
Build a Python development environment on Mac OS X
Build a Python development environment using pyenv on MacOS
Install Python development environment on Windows 10
Build a python3 environment on CentOS7
Build a python environment on MacOS (Catallina)
Creating a python virtual environment on Windows
Build a Python + OpenCV environment on Cloud9
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Build a Python environment on Mac (Mountain Lion)
Build a Kubernetes environment for development on Ubuntu
Set up a Python development environment on Marvericks
Create a Python development environment on Windows (Visual Studio Code remote WSL).
Fastest Python installation on Windows
Django environment development on Windows 10
[ev3dev × Python] Build ev3dev development environment
Build a Python environment offline
Build a Django development environment using pyenv-virtualenv on Mac
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
Build a local development environment for Laravel6.X on Mac
Build a machine learning Python environment on Mac OS
Build a Python extension for E-Cell 4 on Windows 7 (64bit)
Notes on creating a python development environment on macOS Catalina
How to build a Django (python) environment on docker
Build a Python environment on your Mac using pyenv
Build a machine learning application development environment with Python
Procedure for building a CDK environment on Windows (Python)
Create a decent shell and python environment on Windows
How to build a Python environment on amazon linux 2
Create a Python development environment on OS X Lion
Build a machine learning environment natively on Windows 10 (x64)
Build a local development environment with WSL + Docker Desktop for Windows + docker-lambda + Python
Building a Python environment on Mac
Python environment construction memo on Windows 10
Prepare Python development environment on Ubuntu
Anaconda python environment construction on Windows 10
Building a Python environment on Ubuntu
Install python2.7 on windows 32bit environment
[Python3] Development environment construction << Windows edition >>
Create a Linux environment on Windows 10
Python development environment construction on macOS
Create a python environment on centos
Build Python 3.8 + Pipenv environment on Ubuntu 18.04
Build a python machine learning study environment on macOS sierra
Create a Python (pyenv / virtualenv) development environment on Mac (Homebrew)
How to build a new python virtual environment on Ubuntu
Build an Ubuntu python development environment on Google Cloud Platform
Build a Python development environment in Eclipse (add HTML editor)
Build a python data analysis environment on Mac (El Capitan)
How to build a python2.7 series development environment with Vagrant
Until building a Python development environment using pyenv on Ubuntu 20.04
Build a python environment on CentOS 7.7 for your home server
Create a Python environment for professionals in VS Code on Windows