Subject: Re: vi map question
To: None <>
From: Peter Bex <>
List: netbsd-users
Date: 09/24/2003 22:45:50
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 24, 2003 at 03:11:41PM -0500, Frederick Bruckman wrote:
> I don't see a trivial way to make this a macro, but if you make your
> substition in "ex" mode, like this:
>   :s/^/#/
> you can then repeat it 10 times at some other point in the file, like
> this:
>   :.,+10&
> or repeat it for a block of text (to the next non-blank line), like
> this:
>   :.,/^$/&
> The last is easy to generalize into a macro that comments out the
> entire succeeding block of text (from first non-blank line to the
> following blank line):
>   :map <key> :/./,/^$/s/^/#/^V^V^V^M
> (You have to type Ctrl-V Ctrl-V Ctrl-V Ctrl-M to get a <RETURN> into
> a macro definition.)
> Frederick

Thanks a lot, that last mapping is very useful. I applied a 0x after it to =
rid of the pesky extra hash on the last line.

Now kernel configging is a lot less painful ;)

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)