[prev in list] [next in list] [prev in thread] [next in thread]
List: vim
Subject: Re: using settings for certain files only
From: "Antoine J. Mechelynck" <antoine.mechelynck () belgacom ! net>
Date: 2003-10-04 11:56:42
[Download RAW message or body]
christopher j bottaro <cjb@cs.utexas.edu> wrote:
> hello,
> i want to use the cindent option when editing .h .c .cpp file only.
> all other files, i don't want to use that option. basically, i want
> to use different .vimrc files for different file types. how can i
> accomplish this?
>
> thanks,
> -- christopher
Make your own filetype plugin for each filetype for which you want other
than default behaviour.
See
:help filetype-plugin
The following examples are for Unix/Linux; see at the bottom how to change
them for Dos/Windows.
If you want to totally replace a plugin for an existing filetype, let's say
c, then name it
~/.vim/ftplugin/c.vim
and start it with
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin=1
Similarly, if you want to create a filetype-plugin for a new filetype, let's
say foo, then name it
~/.vim/ftplugin/foo.vim
and start it exactly as above.
If you only want to override one or a few of the default settings (let's say
for filetype c) then put your changes in a file named
~/.vim/after/ftplugin/c.vim
and _don't_ use the 4 lines above.
On Dos/Windows, if you have a HOME environment variable pointing to a valid
directory (look at it by doing ":echo $HOME" in Vim), then replace
everywhere above "~/.vim/" by "~/vimfiles/"; otherwise, replace it by
"$VIM/vimfiles/".
HTH,
Tony.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic