So you've given Vim a try and have gotten all those commands engrained into your memory. Or at least, you're hooked to the point of wanting to use Vim for some more stuff. But then you discover that one of the features you need doesn't work. For me, both the Python and TCL libraries that the official Vim download uses were older than the ones on my computer. Because the support for these languages depended on the older versions, Vim wasn't able to support them on my computer out-of-the-box, and installing older versions of the languages just so the editor will work seems silly. So I did what any sensible person would do and decided to build my own. The following process will be fairly specific to the issues I ran into building Vim to my needs, but it should be useful to just about anyone wanting to compile Vim on Windows (if you're compiling on a UNIX-like system, I expect you can do it without help).
Before we can actually do any building, you need to download the appropriate files. This includes any languages you want compiled in (I included Python, Perl, TCL, and Ruby), plus the tools to build Vim and the Vim sources. I'll assume you can isntall the languages and add them to your PATH yourself, so I'll only go through getting the Vim stuff working.
A successful installation of Cygwin or MinGW should give you access to the GNU Compilers (gcc and g++) and the GNU make utility from the windows command prompt. If you type those commands and get a "...is not recognized as an internal or external command..." error, then please check the documentation for your repsective tool on how to set up the PATH environment variable to work with your tool.
cd C:\vim\vim71\srcIf you unzipped to another location, use that path instead of what I provided here, so long as you get to the src directory.
GUI=yes PERL_VER=56 DYNAMIC_PERL=yes PYTHON_VER=25 DYNAMIC_PYTHON=yes TCL_VER=84 DYNAMIC_TCL=yes RUBY_VER=18 RUBY_VER_LONG=1.8 DYNAMIC_RUBY=yesThose will set you up for Perl version 5.6, Python version 2.5, TCL version 8.4, and Ruby version 1.8. If you are using different vesions, just replace the appropriate version number with what you have. We've also ensured that building the GUI version is the default. Some people will argue that we could have included all of this on the command line when we run make, and while that's true, I'd rather not have to type all of that every time, so I like to edit the Makefile to have the defaults I want.
C:\ruby\lib\ruby\1.8\i386-mswin32\config.hAt the top of this file, you'll see three lines like follows:
#if _MSC_VER != 1200 #error MSC version unmatch #endifThese commands prevent this file from being used by any compiler aside from a Microsoft compiler of a certain version or higher. Since we aren't using a Microsoft compiler, this will always fail and prevent us from building Vim. Comment out those lines with /* */, as follows:
/*#if _MSC_VER != 1200 #error MSC version unmatch #endif*/
make -f Make_cyg.mak gvim.exe \ PERL=C:/perl \ TCL=C:/TCL \ PYTHON=C:/Python25 \ RUBY=C:/rubyReplace the paths given for the programming languages with the path to your installation of the language. While you could also specify these in the Makefile, I think it's useful to keep simple options like these present on the command line so you have at least a little idea of what's being built. Besides, what if you want to build again and decide to drop TCL? If you do it this way, just don't provide a path and it won't be included. Note that the \ simply tells BASH that we're continuing the command on the next line. This could all be put on one line.
OLE=yesto the preceding make command.
make -f Make_cyg.mak vim.exe \ GUI=no \ PERL=C:/perl \ TCL=C:/TCL \ PYTHON=C:/Python25 \ RUBY=C:/rubyThe differences should be fairly obvious. We tell it to build the target vim.exe with no GUI, but otherwise everything is the same.
C:\Program Files\vim C:\Program Files\vim\vim71
make -f Make_cyg.mak cleanJust make sure you've moved your gvim.exe and/or vim.exe before you do this!