Monday, July 30, 2012

Re: Filetype detection on vim

On 30/07/12 3:10 PM, Gary Johnson wrote:
> On 2012-07-29, Ben Fritz wrote:
>> On Saturday, July 28, 2012 11:10:35 PM UTC-5, Tony Mechelynck wrote:
>>> On 27/07/12 12:49, ansuman wrote:
>
>>>> I want to add a new filetype with extention .pn. For this I
>>>> had done following:
>>>>
>>>> I went to vim installation directory i.e. vim73 and I edited
>>>> filetype.vim. I added following line
>>>>
>>>> au BufNewFile,BufRead *.pn setf potion
>>>>
>>>> in between augroup filetypedetect and augroup END
>
>>>> Am I doing any wrong?
>
>>> What I recommend is to add a new filetype.vim in one of the
>>> following places (shown as they would appear in Vim):
>>>
>>> - Single-user on Windows
>>>
>>> $HOME/vimfiles/filetype.vim
>>
>> I actually prefer creating a file per filetype in
>> $HOME/vimfiles/ftdetect, as detailed at the beginning of :help
>> new-filetype
>
> I agree that Ansuman should put his changes in one of the preferred
> locations, but I sure can't see why they're not working for him
> where they are.

Agreed.

My best guess is that filetype detection hasn't actually been enabled at
all.

Does issuing

:filetype

give any insight?

Another possibility is that there are two installations of Vim on the
machine. Does

:echo $VIMRUNTIME

give any insight?

Ben.



--
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

No comments: