GVim Portable
The famous editor made portable
»Home
»Licence
»Installation
»Configuration
»Downloads
»Build
»FAQ
»Future
»ChangeLog
»Support

Build Portable GVim

The two versions are built using the following BAT-script

@echo off

REM SET VARIABLES
set NAME=GVim_Portable
set FULLVERSION=7.1.0
set LIGHTVERSION=7.1.0
set MAJOR=7
set MINOR=1

REM MAKE CLEAN:
rmdir /S /Q GVimPortable

xcopy /I /S GVimPortable.unpacked GVimPortable

cd GVimPortable\App\vim\vim%MAJOR%%MINOR%
upx --best --compress-icons=0 --nrv2d --crp-ms=999999 -k *.exe
del *.ex~

cd ..\..\..\..
%ProgramFiles%\7-Zip\7z.exe a -mx=9 -sfx7z.sfx %NAME%_%FULLVERSION%.exe GVimPortable
%ProgramFiles%\7-Zip\7z.exe a -mx=9 -tzip %NAME%_%FULLVERSION%.zip GVimPortable

cd GVimPortable\App\vim\vim%MAJOR%%MINOR%

rmdir /S /Q spell
rmdir /S /Q tutor
rmdir /S /Q doc
del install.exe
del uninstal.exe
del vimtutor.bat

REM SAVE RGB.txt
move rgb.txt rgb.txt.foo
del /S *.txt
REM RESTORE RGB.txt
move rgb.txt.foo rgb.txt
del /S *.gif
del /S *.c
del /S *.pdf

cd ..\..\..\..
%ProgramFiles%\7-Zip\7z.exe a -mx=9 -sfx7z.sfx %NAME%LW_%LIGHTVERSION%.exe GVimPortable
%ProgramFiles%\7-Zip\7z.exe a -mx=9 -tzip %NAME%LW_%LIGHTVERSION%.zip GVimPortable

rmdir /S /Q GVimPortable

pause

Compiling GVim

  • Setup cygwin and install gcc, patch, zip.

  • create the following directory hirarchy

-$HOME
  +/devel/
    +/build_w32gvim.sh
    +/vimsrc/
      +/vim-7.1.tar.bz2
      +/vim-7.1-extra.tar.gz
      +/vim-7.1-lang.tar.gz
      +/patches-vim-7.1/
        +/patchfiles

and here is the content of build_w32gvim.sh

#!/bin/sh

MAJOR=7
MINOR=1

SRC="$PWD/vimsrc/"
DST="$PWD/vim/"
PATCHES="$SRC/patches-vim-$MAJOR.$MINOR/"

#clean up
rm -rf $DST
mkdir $DST

#install sources
tar -jxvf vimsrc/vim-$MAJOR.$MINOR.tar.bz2 -C $DST
tar -zxvf vimsrc/vim-$MAJOR.$MINOR-extra.tar.gz -C $DST
tar -zxvf vimsrc/vim-$MAJOR.$MINOR-lang.tar.gz -C $DST

#apply patches
cd $DST/vim$MAJOR$MINOR
cat $PATCHES/$MAJOR.$MINOR.[0-9][0-9][0-9] | patch -p0

#build source
cd $DST/vim$MAJOR$MINOR/src/
#USERNAME=rck USERDOMAIN=none make -B -f Make_cyg.mak OLE=yes
USERNAME=rck USERDOMAIN=none make -B -f Make_cyg.mak GUI=yes OLE=no

#build gvimpackage
cd $DST/vim$MAJOR$MINOR
cp src/gvim.exe .
cp src/xxd/xxd.exe ./xxdw32.exe
cp src/vimrun.exe .
cp src/install.exe ./installw32.exe
cp src/uninstal.exe ./uninstalw32.exe
cp src/GvimExt/gvimext.dll .
touch gvim.pdb
make dosbin_gvim

#build runtime
#DOES NOT WORK anymore :-/
#run 'make dosrt' outside the script.
#cd $DST/vim$MAJOR$MINOR
#make dosrt

This will create zip files for the runtime environment and for gvim. They can be found in the vim/vim71/dist/ directory.