Thursday, June 17, 2010

Re: How to test filetype in _vimrc

On 06/17/2010 11:20 AM, Roy Fulbright wrote:
>
> I am trying to test for filetype '.bat' in _vimrc and set syntax off. I tried adding the following to _vimrc but it does not work:
>

>
> if v:fname_in =~ '.bat$'
>
>    syntax off
>
> end if
>

>
> I echoed v:fname_in and it was NULL. I also echoed v:fname_out and it was also NULL. That seems strange. Can someone offer a solution?
>

>
> Thanks,
>
> Roy Fulbright
>

>                           
> _________________________________________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
>


What you want is something like this:

:au BufNew,BufRead *.bat :syntax off

see :help :au

   -ak

--
 Python plugins for vim: outliner, todo list, project manager, calendar,
 expenses tracker, sortable table, and more | http://lightbird.net/pysuite/


No comments: