Found something useful? Don't forget to leave a comment!

Sunday, July 11, 2010

Whip Cygwin’s vim into shape

If you’re a Windows user like me but do a lot of editing/development work on Linux, chances are you rely on the Cygwin environment and its host of software. One of the staples of Linux is the editor vim. Cygwin’s vim, however, is configured by default to run in old-school vi mode. That means no nice colors, no statusbar messages, and bad arrow-key/cursor support. A far cry from how vim works in modern Linux distros, that’s for sure.

The solution? Easy.

Create an blank .vimrc file in your Cygwin home directory. Better yet, enable autoindent by adding these four lines:

set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set pastetoggle=<F2>

If you’re a heavy user of vim on Cygwin, I’m sure you will find this to be a godsend.

No comments: