Re: when is filetype set?
- On Wed, Jan 03, 2001 at 01:53:55PM -0500, Benji Fisher wrote:
> > > " Set up your defaults for all filesIn my case, I actually have it this way, partly taken from Sven's .vimrc:
> > > syn on
> > > au FileType * se cindent nu
> > > " Specific to files of filetype mail
> > > au FileType mail syn clear
> > > au FileType mail se tw=78 noai
> Does this work? I do not think it should. IIRC, the standard Syntax
> autocommands are defined after the vimrc file is sourced. Since
> autocommands are executed in the order they are defined, I do not think
> yours will have any effect. Maybe if you put it in the gvimrc instead of
> the vimrc...
" Only do this part when compiled with support for autocommands.
" Remove all cprog autocommands
" When starting to edit a file:
" For C and C++ files set formatting of comments and set C-indenting
" For other files switch it off.
" Don't change the order, it's important that the line with * comes
if version >= 5.4
autocmd FileType * set formatoptions=tcql
autocmd FileType c,cpp,h set formatoptions=croql
" Source our .tex definitions if it's a .tex file.
au FileType tex so ~/.vimtexrc
" Set up settings for mail.
au FileType mail syn clear
au FileType mail se tw=78 noai
This seems to work just fine.
> There is a way to customize syntax highlighting. It will beI'll do that. ;-)
> different (and easier) in vim 6.0. If you are planning to RTFM, I suggest
> the following topics:
> :help startup
> :help mysyntaxfile
Michael P. Soulier <msoulier@...>
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort." -Harley Hahn, A Student's Guide to UNIX
PGP Public Key: http://www.storm.ca/~msoulier/email.phtml