Thursday, June 17, 2010

RE: How to test filetype in _vimrc


 

Date: Thu, 17 Jun 2010 11:23:28 -0400
From: andrei.avk@gmail.com
To: vim_use@googlegroups.com
Subject: 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
>

What you want is something like this:

:au BufNew,BufRead *.bat :syntax off

see :help :au

   -ak

Thanks for the reply. I tried using the 'au' command you mentioned, but syntax still remains ON when I open a '.bat' file. This is one of those things I know should not be this difficult, yet the solution remains elusive.
 


Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. See how.

No comments: