On 2011-07-16, Eric Weir wrote:
> On Jul 16, 2011, at 7:11 PM, Gary Johnson wrote:
>
> > 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?
>
> Thanks Gary,
>
> There is one feature, unrelated to markdown, that all the files in
> question would have: at least one CamelCase name. I have no idea
> how to convert that into a rule, though I imagine you guy's could
> do it in a snap.
>
> I think the better route is going to be the one offered by Thilo
> and Tony -- using the path to the files to define the filetype.
> I've taken a stab at how that might be done in my response to
> Tony. Your explanation leads me to think that I will have to
> create a script and put it where you said to put it.
>
> I assume scripts.vim can contain multiple scripts?
It can contain multiple rules for multiple file types.
The reason it is named scripts (plural) is that its original purpose
was to distinguish between various scripting languages used in Unix
scripts which typically do not have filename suffixes. As the first
line of $VIMRUNTIME/scripts.vim states, it is a
" Vim support file to detect file types in scripts
You're dealing with the same problem that scripts.vim addresses--
your files just aren't scripts.
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