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

automatically syntax by file extensions

Expand Messages
  • Vu The Cuong
    ... From: Vu The Cuong To: vim@vim.org Sent: Friday, September 02, 2005 2:43 PM Subject: automatically syntax by file extensions Currently I always open files
    Message 1 of 3 , Sep 1, 2005
    • 0 Attachment
      ----- Original Message -----
      From: Vu The Cuong
      To: vim@...
      Sent: Friday, September 02, 2005 2:43 PM
      Subject: automatically syntax by file extensions


      Currently I always open files with *.php. *.html, *.c etc extensions.
      Each time I after opening a file type, I must do:
      - set filetype=php
      or
      - set filetype=c
      or
      - set filetype=html
      So it takes time.
      Is there a way to tell Vim to automatically detect files extensions and
      use syntax corresponding to that file.
      many thanks
    • Tony Mechelynck
      ... From: Vu The Cuong To: Sent: Friday, September 02, 2005 7:45 AM Subject: automatically syntax by file
      Message 2 of 3 , Sep 1, 2005
      • 0 Attachment
        ----- Original Message -----
        From: "Vu The Cuong" <cuongvt@...>
        To: <vim@...>
        Sent: Friday, September 02, 2005 7:45 AM
        Subject: automatically syntax by file extensions


        >
        > ----- Original Message -----
        > From: Vu The Cuong
        > To: vim@...
        > Sent: Friday, September 02, 2005 2:43 PM
        > Subject: automatically syntax by file extensions
        >
        >
        > Currently I always open files with *.php. *.html, *.c etc extensions.
        > Each time I after opening a file type, I must do:
        > - set filetype=php
        > or
        > - set filetype=c
        > or
        > - set filetype=html
        > So it takes time.
        > Is there a way to tell Vim to automatically detect files extensions and
        > use syntax corresponding to that file.
        > many thanks
        >
        >

        Place in your vimrc:

        filetype on
        or
        source $VIMRUNTIME/vimrc_example.vim

        (the latter includes, among many other things, "filetype plugin indent on")

        see
        :help :filetype
        :help :filetype-overview
        :view $VIMRUNTIME/vimrc_example.vim
        :help vimrc_example.vim


        Best regards,
        Tony.
      • Vu The Cuong
        thanks.:) it simple but help me a lot. ... From: Tony Mechelynck To: Vu The Cuong ;
        Message 3 of 3 , Sep 1, 2005
        • 0 Attachment
          thanks.:) it simple but help me a lot.
          ----- Original Message -----
          From: "Tony Mechelynck" <antoine.mechelynck@...>
          To: "Vu The Cuong" <cuongvt@...>; <vim@...>
          Sent: Friday, September 02, 2005 3:01 PM
          Subject: Re: automatically syntax by file extensions


          > ----- Original Message -----
          > From: "Vu The Cuong" <cuongvt@...>
          > To: <vim@...>
          > Sent: Friday, September 02, 2005 7:45 AM
          > Subject: automatically syntax by file extensions
          >
          >
          > >
          > > ----- Original Message -----
          > > From: Vu The Cuong
          > > To: vim@...
          > > Sent: Friday, September 02, 2005 2:43 PM
          > > Subject: automatically syntax by file extensions
          > >
          > >
          > > Currently I always open files with *.php. *.html, *.c etc extensions.
          > > Each time I after opening a file type, I must do:
          > > - set filetype=php
          > > or
          > > - set filetype=c
          > > or
          > > - set filetype=html
          > > So it takes time.
          > > Is there a way to tell Vim to automatically detect files extensions and
          > > use syntax corresponding to that file.
          > > many thanks
          > >
          > >
          >
          > Place in your vimrc:
          >
          > filetype on
          > or
          > source $VIMRUNTIME/vimrc_example.vim
          >
          > (the latter includes, among many other things, "filetype plugin indent
          on")
          >
          > see
          > :help :filetype
          > :help :filetype-overview
          > :view $VIMRUNTIME/vimrc_example.vim
          > :help vimrc_example.vim
          >
          >
          > Best regards,
          > Tony.
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.