How to get vim color mode to work in vim under cygwin

You have to (either run or) add the following command to your ~/.vimrc file:

:syntax on


I later found that I had installed both vi and vim on Cygwin, so I added this to my .bashrc:

alias vi="/usr/bin/vim"

and then created the following ~/.vimrc file:

" double-quotes are comments for the .vimrc file
set nocompatible
set nocp
set backspace=indent,eol,start
set term=xterm-256
syntax on
set hlsearch
set t_Co=8
set t_Sb=m
set t_Sf=m

I now have syntax highlighting, INSERT/REPLACE on the home bar, as well as correct arrow key operation and backspace/delete key operation during INSERT mode. Cygwin vi now behaves as my normal Linux vi.


As of vim-7.3.943 the vi binary is now compiled with the small featureset. To get syntax highlighting you must use vim (or alias vi to vim...).

This is likely a newer version than was available at the time of OP, but it is relevant now and is still v7.3 as listed in the OP.


For Cygwin by default, if you haven't installed vim you actually have vi. So just go onto Cygwin setup and search for vim and its under the Editors. Then colored syntax should all be enabled no changes required.