[ubuntu-uk] Advanced vi/vim command - commenting out a large section
DarkOtter
hello at darkotter.com
Mon Aug 18 17:48:19 BST 2008
> > But, what I'd love, is a way I can type say 11 <command> and get it to
> > turn 11 lines into a comment.
> >
> > Does anyone know of a nice way to do that in vim?
It's a little bit hacky, but the way I do that is to do a substitute with the
'start of line' token in the regexp. That way you can use a standard vim range
e.g. 1,10 to do lines 1 to 11
I just do e.g. :{range}s/^/# /
Probably not the best way to do it. Is there a prepend command in vim? That
would be more appropriate.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/ubuntu-uk/attachments/20080818/875c6340/attachment.pgp
More information about the ubuntu-uk
mailing list