Loading ...
Sorry, an error occurred while loading the content.

15532Re: when is filetype set?

Expand Messages
  • Benji Fisher
    Jan 3, 2001
      "Michael P. Soulier" wrote:
      >
      > On Wed, Jan 03, 2001 at 03:10:54PM +0530, Janakiraman .S wrote:
      >
      > > I dont think so. You will need to execute this each time you load a
      > > buffer.
      > >
      > > Also syn off turns syntax highlighting off on all buffers.
      > > syn clear will clear it for the current buffer alone.
      >
      > Gotcha.
      >
      > > I suggest using autocommands to achieve what you want.
      > > Something like
      > >
      > > " Set up your defaults for all files
      > > 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
      >
      > Ok, I had to tweak this a bit because it was conflicting with other
      > settings, but I believe it's finally working.
      >
      > Thanks for your help, and I'll read up the docs again. ;-)
      >
      > Mike

      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...

      There is a way to customize syntax highlighting. It will be
      different (and easier) in vim 6.0. If you are planning to RTFM, I suggest
      the following topics:

      :help startup
      :help mysyntaxfile

      HTH --Benji Fisher
    • Show all 5 messages in this topic