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

119910Re: Substitute within a highlight group.

Expand Messages
  • David Fishburn
    Jan 1, 2011

      On 12/30/2010 10:41 PM, sergio wrote:
      On 12/31/2010 06:13 AM, David Fishburn wrote:

      As Chip mentioned, I definitely want to know of any bugs.

      I've not understand how to select highlight group from script.
      (For example I need to select zoneSerial group)

      % vim bindzone
      :source incoming/srhg/plugin/SrchRplcHiGrp.vim
      <GOTO zone serial>
      SRHiGrp - Group ID: 97  Name: zoneSerial
      :SRHiGrp '\(.*\)','__\1__'
      .* also includes comment, that exists on this line: so I get:
      __2007031901 ; serial__
      instead of:
      __2007031901__ ; serial

      This one is tough.

      What the plugin does, it is positions the cursor to the required highlight group and then runs Vim's standard regex.

      Since you said .*, that means until the end of the line.

      I think what you wanted to do in your case was simply:
      :SRHiGrp '\(\w\+\)','__\1__'
      :SRHiGrp '\(\d\+\)','__\1__'

      This took care of the entire file:
      :%SRHiGrp '\(\d\+\)','__\1__'

      <GOTO ip address>
      SRHiGrp - Group ID: 94  Name: zoneIPAddr
      goes to the next octet of selected ip address, not to the next ip address.

      <GOTO zoneDirective>
      SRHiGrp - Group ID: 89  Name: zoneDirective
      first SRSearch (from neutral space) goes to '$' of next directive,
      second --- to the first letter after $ of the same directive.

      I agree.

      I have uploaded a new version 5.0 to address this.

      Please provide further feedback if you have more.

      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 19 messages in this topic