Compiling Vim with python support on Windows :

Building Vim with Python support on Windows

Vim does not have a native Python 2.6 support on Windows, so you'll have to build it yourself.

The site ShowMeDo gives a nice turorial on the subject.

I'm listing here the important steps :

  1. Install MingW, directly or by another programm (I personnaly installed Qt4.4 on Windows with MingW inside it) ;
  2. Download and Install binaries of GVim on the official Vim site;
  3. Download vim72src.zip on the Vim site;
  4. Unzip it and go to the src dir;
  5. Edit the file Make_ming.mak

The Python section starts at line 130, modify it as follows :

# Python support -- works with the ActiveState python 2.0 release (and others
# too, probably)
#
# uncomment 'PYTHON' to make python-enabled version
# Put the path to the python distro here.  If cross compiling from Linux, you
# will also need to convert the header files to unix instead of dos format:
#   for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
# and also, you will need to make a mingw32 'libpython20.a' to link with:
#   cd $PYTHON/libs
#   pexports python20.dll > python20.def
#   dlltool -d python20.def -l libpython20.a
# on my Linux box, I put the Python stuff here:
#PYTHON=/home/ron/ActivePython-2.0.0-202/src/Core
# on my NT box, it's here:
PYTHON=c:/python26

ifdef PYTHON
ifndef DYNAMIC_PYTHON
DYNAMIC_PYTHON=no
endif

ifndef PYTHON_VER
PYTHON_VER=26
endif

Then, compile with :

mingw32-make -f Make_ming.mak gvim.exe

You just have to replace the old gvim.exe by the new one you've just compiled.

Note: Since this article, Vim 7.2 appeared and the given source file does not work as expected. I had to use the source file from SVN directory to get it work correctly.

Note 2: Compiling with Ruby support gave me a lot of errors, I have to find why.

To test if Python is installed, type the following :

:echo has("python")

This should return 1 (for True).

Setting the fonts

To set the default fonts, you have to modify you vim.rc :

Under Linux, you'll have to write this : set guifont=Consolas\ 12 Under a Windows machine, this is done like this : set guifont=consolas:h12

Comments
Back to index
blog comments powered by Disqus

Atom feeds