On 2011-07-16, Eric Weir wrote: > On Jul 16, 2011, at 12:59 PM, Javier Rojas wrote: > > > In Vim you can define the type of a file using 2 methods: > > > > * checking its extension, or filename > > * checking its contents, if the filename has no useful info for > > defining the filetype. > > > > The help section I pointed you to shows how to check the content of a > > file to define its filetype. > > As I understand it, the script recommended will inspect the > content of o [new?] file and assign a filetype accordingly. > > If that is correct, I don't know what content should be specified. > > Is there a way to determine the filetype of a specific file?
If you were to open an arbitrary file with Vim, could you tell by looking at it whether it contained markdown? If so, how? Can you describe to someone else how to recognize the contents as markdown? If so, then Vim can probably be told to recognize it, too, and all you have to do is put that description in ~/.vim/scripts.vim. It doesn't have to be an exhaustive description. What you want to find is a simple rule or pattern or test that can be evaluated to answer, yes or no, is the content of this file markdown? Regards, Gary -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
