Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For interest's sake, here's how I did it as a recorded macro:</p> <pre><code>qq0"+df=xA&lt;BACKSPACE&gt; = &lt;ESC&gt;"+pxi;&lt;ESC&gt;jq </code></pre> <p>Peforming that on the first line sets the "q" macro to do what's required. Then on each subsequent line you can execute the macro by typing:</p> <pre><code>@q </code></pre> <p>or, say you want to apply the macro to the next 10 lines:</p> <pre><code>10@q </code></pre> <p>I always find macros easier for a quick switch like this than figuring out the regex, because they're essentially an extension of how I would do it by hand.</p> <p><strong>Edit</strong>: Dan Olson points out in his comment that if you want to then apply the macro to a range of lines, for instance lines 6-100, you can enter the following. I don't know if there's a more concise syntax that doesn't require the ".*" pattern match.</p> <pre><code>:6,100g/.*/normal @q </code></pre> <p><strong>Explanation of the macro</strong></p> <ul> <li>qq <ul> <li>start recording in register q</li> </ul></li> <li>0 <ul> <li>go to beginning of line</li> </ul></li> <li>"+df= <ul> <li>delete up to the '=' and put the text into the '+' register</li> </ul></li> <li>x <ul> <li>delete extra space</li> </ul></li> <li>A <ul> <li>go to end of line and enter insert mode</li> </ul></li> <li><code>&lt;BACKSPACE&gt;</code> = <code>&lt;ESC&gt;</code> <ul> <li>Delete the semicolon, insert an equals sign and a space</li> </ul></li> <li>"+p <ul> <li>insert the test copied earlier into register '+'</li> </ul></li> <li>xi;<code>&lt;ESC&gt;</code> <ul> <li>reinsert the trailing semicolon</li> </ul></li> <li>j <ul> <li>move down to the next line, ready to reapply the macro</li> </ul></li> <li>q <ul> <li>stop recording</li> </ul></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload