Loading ...
Sorry, an error occurred while loading the content.

Re: turning off modelines from a modeline

Expand Messages
  • Thomas S. Urban
    ... ... Tested, works, thanks. Scott -- Q: What s the difference between a dead dog in the road and a dead lawyer in the road? A: There are skid marks
    Message 1 of 3 , Jan 31, 2002
    • 0 Attachment
      On Thu, Jan 31, 2002 at 08:46:36PM +0100, Bram Moolenaar wrote:
      >
      > Thomas S. Urban wrote:
      <snip>
      > > # vim: set nomodeline modelines=0 :
      > >
      > > 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
      >
      > (untested!)

      Tested, works, thanks.

      Scott

      --
      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.
    Your message has been successfully submitted and would be delivered to recipients shortly.