vimrc: an example of vim configuration file

I think vim is the most powerful editor running on linux, but if you want to use it efficiently you need to spend some minutes to configure it.

You can configure vim for all users creating a vimrc file in /etc/vim/ and then adding an alias like the following:

alias vim='vim -u /etc/vim/vimrc'

or each user can configure vim creating a .vimrc file in his home directory (~).

Anyway, IMHO, there are some useful configurations that should be present in a vimrc configuration file for a programmer. The following lines show my minimal (and preferred) configuration file:

 

 

~# cat .vimrc

" vim configuration file

" www.xappsoftware.com


" the following line sets tabs to 4 spaces.

set ts=4


" the following line adds line number to the text.

set nu


" the following line activates the syntax highlighting.

syntax on


" the following line says to vim to highlight the searched words.

set hlsearch


" the following line says to vim to execute incremental search.

set incsearch


" the following line enables the use of the mouse.

set mouse=a

 
That's all
Gg1
Posted by at February 5, 2011
Filed in category: linux, Mac OS X, and tagged with:

One Response to vimrc: an example of vim configuration file

  1. Pingback: Opening a file with vim and restoring the last position of the cursor. | xAppSoftware - the xAppSoftware Web Site

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <font color="" face="" size=""> <span style="">

Statistical data collected by Statpress SEOlution (blogcraft).