On 30/12/08 19:14, Daniel Schierbeck wrote:
> I have added several directories to my runtimepath, each corresponding
> to a git repository. For example, I have a directory ~/Projects/vim-
> rack that contains ftdetect/rack.vim and syntax/rack.vim. I'm able to
> manually :set filetype=rack (i.e. the syntax/rack.vim file is picked
> up), but the ftdetect file does not work. It works fine if I create a
> symlink at ~/.vim/ftdetect/rack.vim.
>
> It seems there's a bug in the way ftdetect files are sourced. This
> feeling is amplified by the fact that I can insert syntax errors into
> ~/Projects/vim-rack/ftdetect/rack.vim without Vim complaining on
> startup.
>
>
> I hope there's a simple workaround.
>
>
> Cheers,
> Daniel Schierbeck

$VIMRUNTIME/filetype.vim (current version, 2008 Dec 08) includes the 
following at lines 2419-2421:

> " Use the plugin-filetype checks last, they may overrule any of the previously
> " detected filetypes.
> runtime! ftdetect/*.vim

With an exclamation mark after :runtime, it will source every *.vim file 
in the ftdetect/ subdirectory of every directory in 'runtimepath'. This 
is done after "normal" filetype detection. So:

1) Is ~/Projects/vim-rack (without an ending slash) in your 
'runtimepath' option? (Not its ftdetect subdirectory.)
2) If standard filetype detection finds a different default filetype, 
you set it using ":setlocal filetype=rack", not ":setfiletype rack", 
don't you?


Best regards,
Tony.
-- 
How doth the little crocodile
        Improve his shining tail,
And pour the waters of the Nile
        On every golden scale!

How cheerfully he seems to grin,
        How neatly spreads his claws,
And welcomes little fishes in,
        With gently smiling jaws!
                -- Lewis Carrol, "Alice in Wonderland"

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

Raspunde prin e-mail lui