Defining settings based on file ext/type.

2007-01-11 Thread Ramashish Baranwal

Hi,

I would like to know how to define file specific settings (based on
file extension/type). I would prefer modifying my .vimrc file instead
of language specific .vim files. I am trying to achieve something
like-

if file-extension is .c or .cpp
   # expand tabs to spaces
   set sw=4 ts=4 expandtab
else if filetype is Makefile
   # don't expand tabs to spaces
   noexpandtab
endif

Any help would be appreciated. :)

Thanks,
Ram


Associating file extension with filetype.

2006-05-25 Thread Ramashish Baranwal

Hi,

Apologies if this has been answered before (I couldn't find anywhere).
How can I associate a file extension to a file type in my .vimrc file
(e.g.  .hpp extension to c++/cpp file)?

Ram