Sunday, July 29, 2012

Re: Filetype detection on vim

On Saturday, July 28, 2012 11:10:35 PM UTC-5, Tony Mechelynck wrote:
> On 27/07/12 12:49, ansuman wrote:
>
> > Hi,
>
> >
>
> > I am not getting how to add a new filetype to vim. I am on windows and I am
>
> > using vim73.
>
> >
>
> > 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
>
>
>
> Don't change anything in $VIMRUNTIME or below, any upgrade (next week or
>
> 10 years from now) may revert your changes without warning.
>
>
>
> >
>
> > Then I opened my vim with a file with extension .pn.
>
> > I typed following command
>
> > :set filetype?
>
> > and got answer
>
> > filetype=
>
> >
>
> > Am I doing any wrong?
>
> >
>
> > Please help.
>
> >
>
> > Thanks
>
> > Ansuman
>
>
>
> 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

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

Post a Comment