> In a script, how do I get the value of ~ -- the last used
> replace-to string, as used in s//~/ ?

While I've wondered this in the past, and don't have an answer at
the moment, I found a small bug in the help text (or in the :help
command) while hunting.

In Vim7, if I type

        :help ~

and hit control+D to expand the available help items, one of them is

        s/\~

However, if I type

        :help s/\~

and hit <enter>, Vim returns

 E33: No previous substitute regular expression
 E149: Sorry, no help for s/\~

According to a helpgrep (which had to be entered as

        :helpgrep s/\\\~

), there's only one location in the help where this matches,
right next to

        :help s~

I suspect it's a bug for control+D expansion to return something
that, if chosen as the help tag, refuses to jump there.

-tim




Reply via email to