跳到主要內容

VIM on Windows

I have done with the slowness of cygwin git and switch to git-for-windows. Unfortunately, vim on cygwin doesn’t work well with git-for-windows per various path problems (e.g. plugin, path delimiters, etc). Here are some notes for tweaking vim on Windows.

  1. .vim or vimfiles Directories?
    Later one is used on Windows, however, many plugin or your scripts may refer the previous one. Thus, mklink it! i.e. .vim <==> vimfiles.

  2. VIM with Python Support
    Official vim81 compiles vim.exe without python support and gvim.exe with python/dyn (verify that with gvim --version). Thus, Python support is only avail as of gvim.exe per official packages.
    Assume python.exe and python27.dll was installed in C:\Python\bin
    Add following environment variables

    PYTHONHOME=C:\Python\bin
    PATH=%PATH%;%PYTHONHOME%
    

    For :h pythonhome and :h pythondll .
    Verify above settings with :python print ''.

  3. Color Scheme
    gvim requires true color to apply color scheme correctly. Convert your cterm scheme with this script (not mine work).
    Place scheme files in %HOME%\vimfiles\color. Windows equivalent of $HOME\.vim on Unix. Note that %HOME%\.vimrc still works.

  4. gtags
    Jason Hood provides wonderful pre-built gtags for Windows. Download and unzip it. Then add its bin directory to your %PATH%.

  5. gvim specific settings
    Place them in .gvimrc

    set guifont=Consolas:h10:cANSI
    " (not really) maximize window at start
    set lines=999 columns=999
    

Written with StackEdit.

留言