Re: turning off modelines from a modeline
- On Thu, Jan 31, 2002 at 08:46:36PM +0100, Bram Moolenaar wrote:
> Thomas S. Urban wrote:
> > # vim: set nomodeline modelines=0 :Tested, works, thanks.
> > but this doesn't appear to work. Is this supposed to work, or is this
> > perhaps one for the wishlist?
> Vim decides to check for modelines before checking them, thus disabling
> them in the modeline itself doesn't work, you're too late.
> You can use a BufReadPost autocommand that checks the contents of the
> file and may decide to switch off the 'modeline' option.
> au BufReadPost * if getline(1) =~ "vim:nomodeline" | set nomodeline | endif
Q: What's the difference between a dead dog in the road and a dead
lawyer in the road?
A: There are skid marks in front of the dog.