Vi commenting out

Mike Reinehr cmr
Tue Oct 17 07:39:00 PDT 2006


On Tuesday 17 October 2006 05:57, Roger Oberholtzer wrote:
> On Tue, 2006-10-17 at 08:22 +0100, Jorge Almeida wrote:
> > On Mon, 16 Oct 2006, Michael Hipp wrote:
> > > Is there any simple trick for having vi comment out a whole range of
> > > lines by placing a '#' in front of them? The manual method of i # ESC j
> > > is rather tedious if there is a big section to be done.
> >
> > Are you talking about the real vintage vi, as opposed to vim?
> >
> > With vim, I select the range in visual mode and just do :s/^/#/
> > Actually, I use a visual mode macro to do it (Ctrl-X Ctrl-D to comment
> > and Ctrl-X Ctrl-U to uncomment). It's as easy as I could wish.
> > (Don't know a thing about vi...)
>
> My vim (6.3.84) does not do this. How are you selecting the text to
> comment?
> Is this macro (Ctrl-X Ctrl-D) something you have defined?
>

I bet it does. On my system, for example, you have to start `gvim` or `vim -g` 
to start the graphical version of vim. In fact, gvim is a link to vim.gtk. 
Typing vi or vim just starts the standard non-graphical vim.

cmr
-- 
Debian 'Etch': Registered Linux User #241964

"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list