On Thu 1-Feb-07 8:23am -0600, Naim Far wrote:
> I liked the following replacement command, and I found it very usefull:
> :let n=0|g//s//\=n/|let n+=1
>
> But, could anyone please explain the way it works?!
> I used the "help :=" to try and understand it, but the vim help says the
> ":=" command displays the line number, which cannot explain the way the
> command above works
When pattern is missing in :g or s:, it uses the last
pattern of global, substitute or search - in the OPs
example, it was being used after a search.
For \= see
:h sub-replace-\=
In the example, it is evaluating the variable - so its value
is substituted.
--
Best regards,
Bill