[ubuntu-uk] Advanced vi/vim command - commenting out a large section

Matthew Macdonald-Wallace matthew at truthisfreedom.org.uk
Mon Aug 18 17:28:51 BST 2008


Quoting Johnathon Tinsley <kirrus at kirrus.co.uk>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> We sometimes need to quickly comment out a, for example, vhost config in
> vi. Now, I've worked out that you can add the first comment #, ESC and
> then hit DOWN, FULL-STOP, DOWN, FULL-STOP etc to quickly comment out
> multiple lines.
>
> 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?

CTRL-v (number), DOWN ARROW, SHIFT-i, #, ESC, DOWN ARROW

works for me...

M.
-- 
Matthew Macdonald-Wallace
matthew at truthisfreedom.org.uk
http://www.truthisfreedom.org.uk/




More information about the ubuntu-uk mailing list