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

Re: Vim question



On 23/10/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 (hit 'escape' twice)
go to the first line and type

:.,+10s/^/#/

which says:

'select (s) from the current line to ten lines down(.,+10),

then replace beginning of line(^) with a #


> just to be more clear, i want to rasform
>
> a=['a','b','c']
> for i in a:
>     do_something(i)
>     print i
>
> to
>
> #a=['a','b','c']
> #for i in a:
> #    do_something(i)
> #    print i
>
> Thnx
> PAolo
> --
>
>
> If you feel is a good idea, pleas correct my poor English
>
> if you have a minute to spend pleas visit my photogrphy site:
> http://mypic.altervista.org
>
>


--
Rasputin :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/



Reply to: