FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-29-2011, 04:52 PM
"John L. Cunningham"
 
Default a quick question: how to add comments for several lines at the same time

On Fri, Sep 30, 2011 at 12:31:00AM +0800, lina wrote:
> Hi,
>
> When I use vim (how can I add comments for several lines at the same time, not
> one by one)
> add #

I set a mark "a" at the first row that I want to comment, then move the
cursor to the last row I want commented and type:

:'a,.s/^/# /g

This assumes you want the comment the entire line.

John


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110929165213.GB7671@infotech">http://lists.debian.org/20110929165213.GB7671@infotech
 
Old 09-29-2011, 05:11 PM
"John L. Cunningham"
 
Default a quick question: how to add comments for several lines at the same time

On Fri, Sep 30, 2011 at 12:56:54AM +0800, lina wrote:
>
> How did you set a mark "a"?

Type:

ma

in command mode.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110929171132.GC7671@infotech">http://lists.debian.org/20110929171132.GC7671@infotech
 

Thread Tools




All times are GMT. The time now is 09:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org