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

26491Re: starting highlight matching brackets in vimrc

Expand Messages
  • Douglas L . Potts
    Mar 1, 2002
    • 0 Attachment
      On Wed, Feb 27, 2002 at 01:59:53PM +0100 Michael Muhler wrote:
      >
      > Hello vimmers,
      >
      > i am using
      > HiMatchBrkt.vim to highlight matching brackets, and it works great.
      > So i wanted to start highlighting matching brackets
      > for all files in vimrc.
      > Unfortunately the plugin only provides some maps
      > to initialize the mode, and the actual function to initialize
      > the mode has a <SID>.
      > Is is possible to call a <SID> function from within vimrc
      > or should i declare a global function
      > in (an edited version of) the script ?

      Don't remember seeing a reply to this one, so I'll give it a shot.

      Possible solutions:
      1. Add a 'publicly accessable' function (ie not a <SID> function) that
      calls the script's initialize function. This would have to be inside
      the script so that this function knows what <SID> translates into so
      that it can call the right function (see :h on scriptnames and
      <SNR>).
      But that isn't very conducive to upgrades made by the author.

      2. Ask the author of HiMatchBrkt.vim to do #1.

      3. Add a line in your vimrc that sets up an autocmd for VimEnter that
      will execute the mapping for you.
      ex: au VimEnter * exe "normal <put script init mapping here>"

      Number 3 is untested, but if not this, a similar setup should work.

      HTH,
      -Doug

      --
      *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
      Douglas L. Potts
      "Writing is easy. It's all a matter of staring at a blank piece of paper
      until your forehead bleeds" -Douglas Adams
      GPG Fingerprint: 768A EEF8 197A 4C9A 5EF7 DA5B 464C 97DF DCD5 68C2
      *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    • Show all 4 messages in this topic