Configuring vim with.vimrc
To configure vim, copy .vimrc from /usr/shares/vim/vim<version>/vimrc_example.vim to your home directory as .vimrc. Note that <version> should be replaced by numeric values for the vim version installed. At the time of updating this webpage, the version was "74." Example:
$ cp /usr/share/vim/vim74/vimrc_example.vim ~/.vimrc
Once copied to your local directory you might want to add a few lines of code around line 53. I usually add the following
colo desert
set tabstop=2
set shiftwidth=2
These additional lines change the syntax highlighting color scheme, the tab width, and the shift distances for more compact code indenting.
My .vimrc is available for download here. Place the file in your Cygwin or Linux home directory.
How to install a vim color scheme
http://www.mkyong.com/linux/how-to-install-a-vim-color-scheme
Color Schemes
- Desert - A Dark Background Color Scheme
Tips and Tricks
- Comment out blocks in vim
- hit ctrl+v (visual block mode)
- use the down arrow keys to select the lines you want (it won't highlight everything)
- Shift+i (capital I)
- insert the text you want, i.e. '! '
- Press ESC
- Indent/Unindent blocks in vim (from stackoverflow)
- To indent, use the
>command. For example, to indent the following five lines of code, in normal/command mode, type:
5>> - To unindent, use the
<command. For example, to unindent the following five lines of code, normal/command mode, type:
5<<
- To indent, use the