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

Re: Syntax highlighting and changing buffers

Expand Messages
  • Antoine J. Mechelynck
    ... To override the default filetype set by $VIMRUNTIME/filetype.vim for all .m files, add the following in ~/.vim/filetype.vim (for Unix) or in
    Message 1 of 7 , Jun 29, 2003
      Denis Crowdy <dcrowdy@...> wrote:
      > On Sun, Jun 29, 2003 at 06:49:10PM +0200, Antoine J. Mechelynck wrote:
      > > Benji Fisher <benji@...> wrote:
      > > [...]
      > > > I suspect some unwanted or obsolete file is getting
      > > > :source'd . I would try
      > > >
      > > > :set verbose=10
      > > > :e foo.m
      > Then Antoine...
      > > What about
      > >
      > > :e foo.m
      > > :scriptnames
      > >
      >
      > Thanks - it seems to be loading up syntax from matlab; so next mission
      > is to check the default file type setting I guess. Off to the manual!
      >
      > Thanks again,
      >
      > Denis Crowdy
      >
      > --
      > Department of Contemporary Music Studies
      > Macquarie University
      > NSW 2109 Australia, ph: +61 (0)2 9850 6787, fax: 9850 6593
      > http://www.ccms.mq.edu.au

      To override the default filetype set by $VIMRUNTIME/filetype.vim for all .m
      files, add the following in ~/.vim/filetype.vim (for Unix) or in
      ~/vimfiles/filetype.vim (for Dos/Windows): (IIRC, you want to set it to
      objc):

      augroup filetypedetect
      au BufEnter,BufNewFile *.m setf objc
      augroup END

      The "setfiletype" command, being read before that in
      $VIMRUNTIME/filetype.vim, overrides it.

      see
      :help :setfiletype
      :help did_filetype()
      :help FileType

      HTH,
      Tony.
    Your message has been successfully submitted and would be delivered to recipients shortly.