> Hi All,
>
> I started VIM without giving the file name and started writing a C program.
> After writing following lines
>
> #include <stdio.h>
>
> int main ()
> {
>     int i;
>
>     for (i = 0; i < 10; i++) {
>         printf ("i=%d", i);
>     }
>     return 0;
> }
>
>
> I ran the command
> :filetype detect
> :set filetype
> filetype=conf
>
> It detected the file as a configuration file.
>
> If I don't type the first line              #include <stdio.h>
> then it is unable to detect the file type.
>
> I am not sure why is it not able to detect the file type.
>
> Any clues!!!!!!!!
>
> Thanks and Regards,
> Prasad

Almost all  file type detection  is made in  "filetype.vim" script in  your VIM
distribution.  Some of then reads the buffer to "find" the type of the file you
are working on.  Others  just trust the extension of the  file name.  C and C++
doesn't have a script to read the buffer  to find out what kind of the file you
are working on.  This isn't needed.  Read the content of the buffer is just for
types that can lead a confusion or are used by more than one syntax type.

Regards.
Alessandro

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to