1INSTALLpc.txt - Installation of Vim on PC 2 3This file contains instructions for compiling Vim. If you already have an 4executable version of Vim, you don't need this. 5 6You can find the latest here: https://github.com/vim/vim-win32-installer 7This page also has links to install support for interfaces such as Perl, 8Python, Lua, etc. 9 10The file "feature.h" can be edited to match your preferences. You can skip 11this, then you will get the default behavior as is documented, which should 12be fine for most people. 13 14This document assumes that you are building Vim for Win32 or later (Windows 15XP/2003/Vista/7/8/10). There are also instructions for pre-XP systems, but 16they might no longer work. 17 18The recommended way is to build a 32 bit Vim, also on 64 bit systems. You can 19build a 64 bit Vim if you like, the executable will be bigger and Vim won't be 20any faster, but you can edit files larger than 2 Gbyte. 21 22 23Contents: 241. Microsoft Visual C++ 252. Using MSYS2 with MinGW 263. Using MinGW 274. Cygwin 285. Cross compiling for Win32 from a Linux machine 296. Building with Python support 307. Building with Python3 support 318. Building with Racket or MzScheme support 329. Building with Lua support 3310. Building with Perl support 3411. Building with Ruby support 3512. Building with Tcl support 3613. Building with Terminal support 3714. Building with DirectX (DirectWrite) support 3815. Windows 3.1 3916. MS-DOS 40 4117. Installing after building from sources 42 43 44The currently recommended way (that means it has been verified to work) is 45using the "Visual Studio Community 2015" installation. This includes the SDK 46needed to target Windows XP. But not older Windows versions (95, 98), see 47|msvc-2008-express| below for that 48 49 501. Microsoft Visual C++ 51======================= 52 53We do not provide download links, since Microsoft keeps changing them. You 54can search for "Visual Studio Community 2015", for example. You will need to 55create a Microsoft account (it's free). 56 57When installing "Visual Studio Community 2015 with Update 3" make sure to 58select "custom" and check "Windows XP Support for C++" and all checkboxes 59under "Universal Windows App Development Tools" 60 61 62Visual Studio 63------------- 64 65Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008, 66VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions 67should also work for VS 4 and VS 5.) 68 69Using VS C++ 2008 Express is recommended if you need the binary to run on 70Windows 95 or 97, see |msvc-2008-express| below. 71 72To build Vim from the command line with MSVC, use Make_mvc.mak. 73Visual Studio installed a batch file called vcvars32.bat, which you must 74run to set up paths for nmake and MSVC. 75 76nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++ 77nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++ 78nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++ 79nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc. 80 Perl, Python, etc. 81 82Make_mvc.mak allows a Vim to be built with various different features and 83debug support. 84 85For compiling Gvim with IME support on far-east Windows, add IME=yes 86to the parameters you pass to Make_mvc.mak. 87 88See the specific files for comments and options. 89 90These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and 91Ron Aaron; they have been tested. 92 93 94Visual C++ 2008 Express Edition *msvc-2008-express* 95------------------------------- 96 97Visual C++ 2008 Express Edition can be downloaded for free from: 98 http://www.microsoft.com/express/downloads/ 99This includes the IDE and the debugger. 100 101To set the environment execute the msvc2008.bat script. You can then build 102Vim with Make_mvc.mak. 103 104For building 64 bit binaries you also need to install the SDK: 105"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1" 106You don't need the examples and documentation. 107 108If you get an error that Win32.mak can't be found, you have to set the 109variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC 110puts include files in the following directory: 111 set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include 112 113 114Visual C++ 2010 Express Edition *msvc-2010-express* 115------------------------------- 116 117Visual C++ 2010 Express Edition can be downloaded for free from: 118 http://www.microsoft.com/express/vc/Default.aspx 119This includes the IDE and the debugger. 120 121To set the environment execute the msvc2010.bat script. You can then build 122Vim with Make_mvc.mak. 123 124 125Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp* 126--------------------------------------------- 127 128Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE 129so that it targets Windows 6.0 (Vista) by default. In order to override 130this, the target Windows version number needs to be passed to LINK like 131follows: 132 LINK ... /subsystem:console,5.01 133 134Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version. 135Use lines like follows to target Windows XP x86 (assuming using Visual C++ 1362012 under 64-bit Windows): 137 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A 138 set INCLUDE=%WinSdk71%\Include;%INCLUDE% 139 set LIB=%WinSdk71%\Lib;%LIB% 140 set CL=/D_USING_V110_SDK71_ 141 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01 142 143To target Windows XP x64 instead of x86, you need to change the settings of 144LIB and SUBSYSTEM_VER: 145 ... 146 set LIB=%WinSdk71%\Lib\x64;%LIB% 147 ... 148 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02 149 150If you use Visual C++ 2015 (either Express or Community Edition), executing 151msvc2015.bat will set them automatically. For x86 builds run this without 152options: 153 msvc2015 154For x64 builds run this with the "x86_amd64" option: 155 msvc2015 x86_amd64 156This enables x86_x64 cross compiler. This works on any editions including 157Express edition. 158If you use Community (or Professional) edition, you can enable the x64 native 159compiler by using the "x64" option: 160 msvc2015 x64 161 162The following Visual C++ team blog can serve as a reference page: 163 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx 164 165 166Cross compile support for Windows on ARM64 167------------------------------------------ 168 169This depends on VS2017 with the optional ARM64 compiler and SDK 170installed. Use "vcvarsall.bat x64_arm64" as the build environment. 171 172The ARM64 support was provided by Leendert van Doorn. 173 174 175OLDER VERSIONS 176 177The minimal supported version is Windows XP. Building with older compilers 178might still work, but these instructions might be outdated. 179 180If you need the executable to run on Windows 98 or ME, use the 2003 one 181|msvc-2003-toolkit|. 182 183Visual C++ Toolkit 2003 *msvc-2003-toolkit* 184----------------------- 185 186You could download the Microsoft Visual C++ Toolkit 2003 from 187 http://msdn.microsoft.com/visualc/vctoolkit2003/ 188Unfortunately this URL is no longer valid. Unofficial downloads appear to be 189available from links mentioned on these pages (use at your own risk): 190 http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html 191 http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit 192 193This contains the command-line tools (compiler, linker, CRT headers, 194and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE. 195To compile and debug Vim with the VC2003 Toolkit, you will also need 196|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|, 197and |windbg-download|. 198 199It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|, 200which is freely available in perpetuity. 201 202The free Code::Blocks IDE works with the VC2003 Toolkit, as described at 203 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE 204(This site also takes you through configuring a number of other 205free C compilers for Win32.) 206 207To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first 208execute the following commands in a cmd.exe window (the msvcsetup.bat batch 209file can be used): 210 211 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH% 212 call "%VCToolkitInstallDir%vcvars32.bat" 213 set MSVCVer=7.1 214 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd" 215 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB% 216 217Now you can build Vim with Make_mvc.mak. 218 219 220Getting the Windows Platform SDK *ms-platform-sdk* 221 222You will also need a copy of the Windows Platform SDK. Specifically, you need 223the Windows Core SDK subset of the Platform SDK, which contains the Windows 224headers and libraries. You need to search for it, Microsoft keeps changing 225the URL. 226 227 228Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist* 229 230You need the .NET Framework 1.1 Redistributable Package from 231 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3 232or from Windows Update: 233 http://windowsupdate.microsoft.com/ 234This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe, 235which is needed to link Vim. 236 237 238Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk* 239 240You need the .NET Framework 1.1 SDK from 241 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d 242This contains some additional libraries needed to compile Vim, 243such as msvcrt.lib. You must install |dotnet-1.1-redist| before 244installing the .NET 1.1 SDK. 245 246 247Getting the WinDbg debugger *windbg-download* 248 249The Debugging Tools for Windows can be downloaded from 250 http://www.microsoft.com/whdc/devtools/debugging/default.mspx 251This includes the WinDbg debugger, which you will want if you ever need 252to debug Vim itself. An earlier version of the Debugging Tools 253is also available through the Platform SDK, |ms-platform-sdk|. 254 255 256Visual C++ 2005 Express Edition *msvc-2005-express* 257------------------------------- 258 259Visual C++ 2005 Express Edition can be downloaded for free from: 260 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx 261This includes the IDE and the debugger. You will also need 262|ms-platform-sdk|. You can build Vim with Make_mvc.mak. 263 264Instructions for integrating the Platform SDK into VC Express: 265 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx 266 267 2682. MSYS2 with MinGW 269=================== 270 2712.1. Setup the basic msys2 environment 272 273Go to the official page of MSYS2: https://www.msys2.org 274Download an installer: 275 276* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows 277 (Even if you want to build 32-bit Vim) 278* msys2-i686-YYYYMMDD.exe for 32-bit Windows 279 280Execute the installer and follow the instructions to update basic packages. 281At the end keep the checkbox checked to run msys2 now. If needed, you can 282open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS. 283 284Execute: 285 $ pacman -Syu 286 287And restart MSYS2 console (select "MSYS2 MSYS" icon from the Start Menu). 288Then execute: 289 $ pacman -Su 290 291If pacman complains that `catgets` and `libcatgets` conflict with another 292package, select `y` to remove them. 293 294 2952.2. Install additional packages for building Vim 296 297The following package groups are required for building Vim: 298 299* base-devel 300* mingw-w64-i686-toolchain (for building 32-bit Vim) 301* mingw-w64-x86_64-toolchain (for building 64-bit Vim) 302 303(These groups also include some useful packages which are not used by Vim.) 304Use the following command to install them: 305 306 $ pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain 307 308Or you can use the `pacboy` command to avoid long package names: 309 310 $ pacboy -S base-devel: toolchain:m 311 312The suffix ":" means that it disables the package name translation. 313The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix 314to install only i686, and the ":x" suffix to install only x86_64. 315(See `pacboy help` for the help.) 316 317See also the pacman page in ArchWiki for the general usage of pacman: 318 https://wiki.archlinux.org/index.php/pacman 319 320MSYS2 has its own git package, and you can also install it via pacman: 321 322 $ pacman -S git 323 324 3252.3. Keep the build environment up-to-date 326 327After you have installed the build environment, you may want to keep it 328up-to-date (E.g. always use the latest GCC). 329In that case, you just need to execute the command: 330 $ pacman -Syu 331 332 3332.4. Build Vim 334 335Select one of the following icon from the Start Menu: 336 337* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim) 338* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim) 339 340Go to the source directory of Vim, then execute the make command. E.g.: 341 342 make -f Make_ming.mak 343 make -f Make_ming.mak GUI=no 344 make -f Make_ming.mak GUI=no DEBUG=yes 345 346NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows 347console for that. You need to set $PATH to be able to build there, e.g.: 348 349 set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH% 350 351This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat: 352 353 set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH% 354 355If you have msys64 in another location you will need to adjust the paths for 356that. 357 358 3593. MinGW 360======== 361 362(written by Ron Aaron: <[email protected]>) 363 364This is about how to produce a Win32 binary of gvim with MinGW. 365 366First, you need to get the 'mingw32' compiler, which is free for the download 367at: 368 369 http://www.mingw.org/ 370 371or you can use 'MinGW-w64' compiler. 372 373 http://mingw-w64.sourceforge.net/ 374 375Or a compiler provided on msys2: 376 377 https://msys2.github.io/ 378 379Once you have downloaded the compiler binaries, unpack them on your hard disk 380somewhere, and put them on your PATH. If you are on Win95/98 you can edit 381your AUTOEXEC.BAT file with a line like: 382 383 set PATH=C:\MinGW\bin;%PATH% 384 385or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance), 386System, Advanced, and edit the environment from there. If you use msys2 387compilers, set your installed paths (normally one of the following): 388 389 C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds) 390 C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds) 391 C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds) 392 393Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window: 394 395 C:\> gcc --version 396 gcc (GCC) 4.8.1 397 398 C:\> mingw32-make --version 399 GNU Make 3.82.90 (...etc...) 400 401Now you are ready to rock 'n' roll. Unpack the vim sources (look on 402www.vim.org for exactly which version of the vim files you need). 403 404Change directory to 'vim\src': 405 406 C:\> cd vim\src 407 C:\VIM\SRC> 408 409and you type: 410 411 mingw32-make -f Make_ming.mak gvim.exe 412 413After churning for a while, you will end up with 'gvim.exe' in the 'vim\src' 414directory. 415 416You should not need to do *any* editing of any files to get vim compiled this 417way. If, for some reason, you want the console-mode-only version of vim (this 418is NOT recommended on Win32, especially on '95/'98!!!), you can use: 419 420 mingw32-make -f Make_ming.mak GUI=no vim.exe 421 422If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX' 423(also free!) and compress the file (typical compression is 50%). UPX can be 424found at 425 http://www.upx.org/ 426 427As of 2011, UPX still does not support compressing 64-bit EXE's; if you have 428built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found 429at: 430 http://www.matcode.com/mpress.htm 431 432 433ADDITION: NLS support with MinGW 434 435(by Eduardo F. Amatria <[email protected]>) 436 437If you want National Language Support, read the file src/po/README_mingw.txt. 438You need to uncomment lines in Make_ming.mak to have NLS defined. 439 440 4414. Cygwin 442========= 443 444Use Make_cyg.mak with Cygwin's GCC. See 445 http://users.skynet.be/antoine.mechelynck/vim/compile.htm 446 447With Cygnus gcc you should use the Unix Makefile instead (you need to get the 448Unix archive then). Then you get a Cygwin application (feels like Vim is 449running on Unix), while with Make_cyg.mak you get a Windows application (like 450with the other makefiles). 451 452 4535. Cross compiling for Win32 from a Linux machine 454================================================= 455 456[Update of 1) needs to be verified] 457 458If you like, you can compile the 'mingw' Win32 version from the comfort of 459your Linux (or other unix) box. To do this, you need to follow a few steps: 460 1) Install the mingw32 cross-compiler. See 461 http://www.mingw.org/wiki/LinuxCrossMinGW 462 http://www.libsdl.org/extras/win32/cross/README.txt 463 2) Get and unpack both the Unix sources and the extra archive 464 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'. 465 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you 466 wish. If your cross-compiler prefix differs from the predefined value, 467 set 'CROSS_COMPILE' corresponding. 468 4) make -f Make_ming.mak gvim.exe 469 470Now you have created the Windows binary from your Linux box! Have fun... 471 472 4736. Building with Python support 474=============================== 475 476For building with MSVC 2008 the "Windows Installer" from www.python.org 477works fine. 478 479When building, you need to set the following variables at least: 480 481 PYTHON: Where Python is installed. E.g. C:\Python27 482 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes. 483 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X. 484 485E.g. When using MSVC (as one line): 486 487 nmake -f Make_mvc.mak 488 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 489 490When using MinGW and link with the official Python (as one line): 491 492 mingw32-make -f Make_ming.mak 493 PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 494 495When using msys2 and link with Python2 bundled with msys2 (as one line): 496 497 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64 498 PYTHON_HOME=c:/msys64/mingw64 499 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7 500 DYNAMIC_PYTHON=yes 501 PYTHON_VER=27 502 DYNAMIC_PYTHON_DLL=libpython2.7.dll 503 STATIC_STDCPLUS=yes 504 505(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.) 506(STATIC_STDCPLUS is optional. Set to yes if you don't want to require 507libstdc++-6.dll.) 508 509 510(rest written by Ron Aaron: <[email protected]>) 511 512Building with the mingw32 compiler, and the ActiveState ActivePython: 513 http://www.ActiveState.com/Products/ActivePython/ 514 515After installing the ActivePython, you will have to create a 'mingw32' 516'libpython20.a' to link with: 517 cd $PYTHON/libs 518 pexports python20.dll > python20.def 519 dlltool -d python20.def -l libpython20.a 520 521Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to 522the root of the Python installation (C:\Python20, for example). If you are 523cross-compiling on Linux with the mingw32 setup, you need to also convert all 524the 'Include' files to *unix* line-endings. This bash command will do it 525easily: 526 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil 527 528Now just do: 529 make -f Make_ming.mak gvim.exe 530 531You will end up with a Python-enabled, Win32 version. Enjoy! 532 533 5347. Building with Python3 support 535================================ 536 537For building with MSVC 2008 the "Windows Installer" from www.python.org 538works fine. Python 3.6 is recommended. 539 540When building, you need to set the following variables at least: 541 542 PYTHON3: Where Python3 is installed. E.g. C:\Python36 543 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes. 544 PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X. 545 546E.g. When using MSVC (as one line): 547 548 nmake -f Make_mvc.mak 549 PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 550 551When using MinGW and link with the official Python3 (as one line): 552 553 mingw32-make -f Make_ming.mak 554 PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 555 556When using msys2 and link with Python3 bundled with msys2 (as one line): 557 558 mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64 559 PYTHON3_HOME=c:/msys64/mingw64 560 PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m 561 DYNAMIC_PYTHON3=yes 562 PYTHON3_VER=36 563 DYNAMIC_PYTHON3_DLL=libpython3.6m.dll 564 STATIC_STDCPLUS=yes 565 566(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.) 567(STATIC_STDCPLUS is optional. Set to yes if you don't want to require 568libstdc++-6.dll.) 569 570 5718. Building with Racket or MzScheme support 572======================================== 573 5741) Building with Racket support (newest) 575 576MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket 577support can be built with either MSVC or MinGW (or Cygwin). 578Get it from https://download.racket-lang.org/ 579 580Copy lib/libracket{version}.dll to your Windows system directory. The system 581directory depends on your Windows bitness and Vim bitness: 582 32-bit Vim on 32-bit Windows: C:\Windows\System32 583 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64 584 64-bit Vim on 64-bit Windows: C:\Windows\System32 585 586For building you need to set the following variables: 587 588 MZSCHEME: Where Racket is installed. 589 E.g. C:\Program Files (x86)\Racket 590 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes. 591 MZSCHEME_VER: Racket DLL version which is used for the file name. 592 See below for a list of MZSCHEME_VER. 593 The DLL can be found under the lib directory. E.g. 594 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll 595 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at 596 runtime. Default: $(MZSCHEME)\collects 597 User can override this with the PLTCOLLECTS environment 598 variable. 599 600List of MZSCHEME_VER (incomplete): 601 602 Racket ver. | MZSCHEME_VER 603 ========================== 604 6.3 | 3m_9z0ds0 605 6.6 | 3m_a0solc 606 6.8 | 3m_a1zjsw 607 6.10 | 3m_a36fs8 608 609 610E.g. When using MSVC (as one line): 611 612 nmake -f Make_mvc.mak 613 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes 614 MZSCHEME_VER=3m_9z0ds0 615 616Or when using MinGW (as one line): 617 618 mingw32-make -f Make_ming.mak 619 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes 620 MZSCHEME_VER=3m_9z0ds0 621 622 Spaces should be escaped with '\'. 623 624 6252) Building with MzScheme support (older) 626 627(written by Sergey Khorev <[email protected]>) 628 629Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can 630be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and 631above (including 299 and 30x series). 632 633The MSVC build is quite straightforward. Simply invoke (in one line) 634nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme> 635 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>] 636where <MzScheme-version> is the last seven characters from MzScheme dll name 637(libmzschXXXXXXX.dll). 638If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme 639DLL's, but will load them in runtime on demand. 640 641Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into 642account that <Path-to-MzScheme> should contain slashes rather than backslashes 643(e.g. d:/Develop/MzScheme) 644 645"Static" MzScheme support (Vim executable will depend on MzScheme DLLs 646explicitly) on MinGW and Cygwin requires additional step. 647 648libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from 649%WINDOWS%\System32 to other location (either build directory, some temporary 650dir or even MzScheme home). 651 652Pass that path as MZSCHEME_DLLS parameter for Make. E.g., 653make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000 654 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no 655 656After a successful build, these dlls can be freely removed, leaving them in 657%WINDOWS%\System32 only. 658 659 660 6619. Building with Lua support 662============================ 663 664Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin). 665You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/ 666This also applies to when you get a Vim executable and don't build yourself, 667do the part up to "Build". 668 6691) Download and install LuaBinaries 670 671Go to the Download page of LuaBinaries: 672 http://luabinaries.sourceforge.net/download.html 673 674Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or 675lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and 676MinGW. 677 678Unpack it to a working directory. E.g. C:\projects\lua53. 679Lua's header files will be installed under the include directory. 680 681Copy luaXY.dll to your Windows system directory. The system directory depends 682on your Windows bitness and Vim bitness: 683 32-bit Vim on 32-bit Windows: C:\Windows\System32 684 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64 685 64-bit Vim on 64-bit Windows: C:\Windows\System32 686 687Or another option is copying luaXY.dll to the directory where gvim.exe 688(or vim.exe) is. 689 690 6912) Build 692 693You need to set LUA, DYNAMIC_LUA and LUA_VER. 694 695 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53. 696 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes. 697 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X. 698 699E.g. When using MSVC (as one line): 700 701 nmake -f Make_mvc.mak 702 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53 703 704Or when using MinGW (as one line): 705 706 mingw32-make -f Make_ming.mak 707 LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53 708 709 710Or when using Cygwin (as one line) (untested): 711 712 make -f Make_cyg.mak 713 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53 714 715 71610. Building with Perl support 717============================== 718 719Vim with Perl support can be built with either MSVC or MinGW (or Cygwin). 720You can use binaries from ActiveState (ActivePerl) or Strawberry Perl. 721 722 http://www.activestate.com/activeperl 723 http://strawberryperl.com/ 724 725When building, you need to set the following variables: 726 727 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl 728 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes. 729 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X. 730 731E.g. When using MSVC (as one line): 732 733 nmake -f Make_mvc.mak 734 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522 735 736Or when using MinGW (as one line): 737 738 mingw32-make -f Make_ming.mak 739 PERL=C:/Perl DYNAMIC_PERL=yes PERL_VER=522 740 741 74211. Building with Ruby support 743============================== 744 745Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin). 746Ruby doesn't provide the official Windows binaries. The most widely used 747Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended. 748 749 http://rubyinstaller.org/ 750 751If you use MinGW you can easily build with RubyInstaller, but if you use MSVC 752you need some tricks described below. 753(Another binary distribution is ActiveScriptRuby: 754 http://www.artonx.org/data/asr/) 755 756When building, you need to set the following variables at least: 757 758 RUBY: Where ruby is installed. E.g. C:\Ruby24 759 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes. 760 RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X. 761 RUBY_API_VER_LONG: Ruby API version in a long format. 762 E.g. 2.4.0 for Ruby 2.4.X. 763 764Ruby version vs. Ruby API version: 765 766 Ruby ver. | Ruby API ver. 767 ========================= 768 1.8.X | 1.8 769 1.9.[1-3] | 1.9.1 770 2.0.0 | 2.0.0 771 2.X.Y | 2.X.0 772 773(Ruby 1.9.0 is excluded from the table because it is an unstable version.) 774 775 776A) Using MSVC 777 778If you want to link with ruby, normally you must use the same compiler as 779which was used to build the ruby binary. RubyInstaller is built with MinGW, 780so normally you cannot use MSVC for building Vim if you want to link with 781RubyInstaller. If you use a different compiler, there are mainly two problems: 782config.h and Ruby's DLL name. Here are the steps for working around them: 783 784 1) Download and Install RubyInstaller. 785 You can install RubyInstaller with the default options and directory. 786 E.g.: 787 C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit) 788 789 Ruby 2.4.X is used in this example. 790 791 2) Download Ruby 2.4.X's source code and generate config.h: 792 793 cd C:\projects 794 git clone https://github.com/ruby/ruby.git -b ruby_2_4 795 cd ruby 796 win32\configure.bat 797 nmake .config.h.time 798 799 Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code. 800 There is no need to build whole Ruby, just config.h is needed. 801 If you use 32-bit MSVC 2015, the config.h is generated in the 802 .ext\include\i386-mswin32_140 directory. 803 If you use 64-bit MSVC 2015, the config.h is generated in the 804 .ext\include\x64-mswin64_140 directory. 805 806 3) Install the generated config.h. 807 808 For 32-bit version: 809 810 xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0 811 812 For 64-bit version: 813 814 xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0 815 816 Note that 2.4.0 is Ruby API version of Ruby 2.4.X. 817 You may need to close the console and reopen it to pick up the new $PATH. 818 819 4) Build Vim. Note that you need to adjust some variables (as one line): 820 821 For 32-bit version: 822 823 nmake -f Make_mvc.mak 824 RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 825 RUBY_MSVCRT_NAME=msvcrt 826 WINVER=0x501 827 828 For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64. 829 830 If you set WINVER explicitly, it must be set to >=0x500, when building 831 with Ruby 2.1 or later. (Default is 0x501.) 832 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt 833 which is used for the Ruby's DLL name. 834 835B) Using MinGW 836 837Using MinGW is easier than using MSVC when linking with RubyInstaller. 838After you install RubyInstaller, just type this (as one line): 839 840 mingw32-make -f Make_ming.mak 841 RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 842 WINVER=0x600 843 844For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64. 845If you set WINVER explicitly, it must be set to >=0x500, when building with 846Ruby 2.1 or later. (Default is 0x600.) 847 848 849 85012. Building with Tcl support 851============================= 852 853Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin). 854You can use binaries from ActiveState (ActiveTcl). 855 856 http://www.activestate.com/activetcl 857 858Alternatively, you can use the binaries provided by IronTcl from 859 860 https://www.irontcl.com/ 861 862They might lack behind the latest version a bit, but should provide 64bit 863and 32bit versions even if ActiveTcl does not provide them anymore. 864 865For building with MSVC 2015 use version 8.6.6 or later. 866When building, you need to set the following variables: 867 868 TCL: Where tcl is installed. E.g. C:\Tcl86 869 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes. 870 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X. 871 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X. 872 873Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll, 874but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting 875the TCL_DLL variable: 876 TCL_DLL=tcl86t.dll 877 878E.g. When using MSVC (as one line): 879 880 nmake -f Make_mvc.mak 881 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6 882 883Or when using MinGW (as one line): 884 885 mingw32-make -f Make_ming.mak 886 TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6 887 888 88913. Building with Terminal support 890================================== 891 892Vim with Terminal support can be built with either MSVC, MinGW or Cygwin. 893This uses the included libvterm and winpty. No extra header files or 894libraries are needed for building. Just set TERMINAL to yes. 895 896E.g. When using MSVC: 897 898 nmake -f Make_mvc.mak TERMINAL=yes 899 900Or when using MinGW: 901 902 mingw32-make -f Make_ming.mak TERMINAL=yes 903 904 90514. Building with DirectX (DirectWrite) support 906=============================================== 907 908Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW. 909This requires dwrite_2.h and some other header files which come with Windows 910SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support. 911This also requires MBYTE=yes which is enabled by default. 912 913A) Using MSVC 914 915If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default. 916You just need to specify DIRECTX=yes: 917 918 nmake -f Make_mvc.mak DIRECTX=yes 919 920If you use MSVC 2012 or earlier, the required header files are not available 921by default. However, you can use the header files from newer SDKs with older 922compilers. E.g.: 923 924 set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um" 925 nmake -f Make_mvc.mak DIRECTX=yes 926 927If you don't need color emoji support, only dwrite.h is required. You can use 928older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.: 929 930 nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no 931 932B) Using MinGW-w64 933 934Just set DIRECTX to yes: 935 936 mingw32-make -f Make_ming.mak DIRECTX=yes 937 938 93915. Windows 3.1x 940================ 941 942The Windows 3.1x support was removed in patch 7.4.1364. 943 944 94516. MS-DOS 946========== 947 948The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions 949work on MS-DOS because of the limited amount of memory available. 950 951 95217. Installing after building from sources 953========================================== 954 955[provided by Michael Soyka, updated by Ken Takata] 956 957After you've built the Vim binaries as described above, you're ready to 958install Vim on your system. However, if you've obtained the Vim sources 959using Git, Mercurial or by downloading them as a unix tar file, you must 960first create a "vim81" directory. If you instead downloaded the sources as 961zip files, you can skip this setup as the zip archives already have the 962correct directory structure. 963 964 A. Create a Vim "runtime" subdirectory named "vim81" 965 ----------------------------------------------------- 966 If you obtained your Vim sources as zip files, you can skip this step. 967 Otherwise, continue reading. 968 969 Go to the directory that contains the Vim "src" and "runtime" 970 directories and create a new subdirectory named "vim81". 971 972 Copy the "runtime" files into "vim81": 973 copy runtime\* vim81 974 975 B. Copy the new binaries into the "vim81" directory 976 ---------------------------------------------------- 977 Regardless of how you installed the Vim sources, you need to copy the 978 new binaries you created above into "vim81": 979 980 copy src\*.exe vim81 981 copy src\tee\tee.exe vim81 982 copy src\xxd\xxd.exe vim81 983 984 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit 985 versions of gvimext.dll. They should be copied to "vim81\GvimExt32" and 986 "vim81\GvimExt64" respectively. 987 First, build the 32-bit version, then: 988 989 mkdir vim81\GvimExt32 990 copy src\GvimExt\gvimext.dll vim81\GvimExt32 991 992 Next, clean the 32-bit version and build the 64-bit version, then: 993 994 mkdir vim81\GvimExt64 995 copy src\GvimExt\gvimext.dll vim81\GvimExt64 996 997 C. Copy gettext and iconv DLLs into the "vim81" directory 998 ---------------------------------------------------------- 999 Get gettext and iconv DLLs from the following site: 1000 https://github.com/mlocati/gettext-iconv-windows/releases 1001 Both 64- and 32-bit versions are needed. 1002 Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract 1003 DLLs and place them as follows: 1004 1005 vim81\ 1006 | libintl-8.dll 1007 | libiconv-2.dll 1008 | libgcc_s_sjlj-1.dll (only for 32-bit) 1009 | 1010 + GvimExt32\ 1011 | libintl-8.dll 1012 | libiconv-2.dll 1013 | libgcc_s_sjlj-1.dll 1014 | 1015 ` GvimExt64\ 1016 libintl-8.dll 1017 libiconv-2.dll 1018 1019 The DLLs in the "vim81" should be the same bitness with the (g)vim.exe. 1020 1021 D. Move the "vim81" directory into the Vim installation subdirectory 1022 --------------------------------------------------------------------- 1023 Move the "vim81" subdirectory into the subdirectory where you want Vim 1024 to be installed. Typically, this subdirectory will be named "vim". 1025 If you already have a "vim81" subdirectory in "vim", delete it first 1026 by running its uninstal.exe program. 1027 1028 E. Install Vim 1029 --------------- 1030 "cd" to your Vim installation subdirectory "vim\vim81" and run the 1031 "install.exe" program. It will ask you a number of questions about 1032 how you would like to have your Vim setup. Among these are: 1033 - You can tell it to write a "_vimrc" file with your preferences in the 1034 parent directory. 1035 - It can also install an "Edit with Vim" entry in the Windows Explorer 1036 popup menu. 1037 - You can have it create batch files, so that you can run Vim from the 1038 console or in a shell. You can select one of the directories in your 1039 PATH or add the directory to PATH using the Windows Control Panel. 1040 - Create entries for Vim on the desktop and in the Start menu. 1041 1042Happy Vimming! 1043