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

Re: starting highlight matching brackets in vimrc

Expand Messages
  • Douglas L . Potts
    ... 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 function)
    Message 1 of 4 , 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
      *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    • Charles E. Campbell
      ... He settled on a #3 style solution -- seems to work apparently. Regards, C Campbell -- Charles E Campbell, Jr, PhD _ __ __ Goddard Space
      Message 2 of 4 , Mar 1, 2002
      • 0 Attachment
        Thus saith Douglas L . Potts:
        > 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.

        He settled on a #3 style solution -- seems to work apparently.

        Regards,
        C Campbell

        --
        Charles E Campbell, Jr, PhD _ __ __
        Goddard Space Flight Center / /_/\_\_/ /
        cec@... /_/ \/_//_/
        PGP public key: http://www.erols.com/astronaut/pgp.html
      Your message has been successfully submitted and would be delivered to recipients shortly.