[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Vim question



On 10/22/05, Paolo Pantaleo <paolopantaleo@gmail.com> wrote:
> I just started learning python (i think it is great). Now i have the
> following problem:
> How can i comment 10 lines of code in a shot? That is, how can i add a
> # at the begenning of a range of lines?

In command mode, I'd go to the *last* line, hit "ma" to mark the spot
with the letter "a", go to the first line, and then type
:.,'as/^/#/

You could use any other letter instead of "a".

--
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
http://mamarsh.blogspot.com



Reply to: