Mailing List Archive

Support open source code!


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

Re: Writting a vi macro, help please.



On Fri, Nov 17, 2000 at 11:59:28AM +0900, Antony Stace wrote:
> Hi Folks
> 
> Can someone please tell me how I can write a macro for vi which will
> insert both a /* at the start of a line and a */ at the end of it.
> 
> ie.
> 
> I am a comment
> 
> becomes
> 
> /*I am a comment*/

:s/^\(.*\)$/\/*\1*\//

I never did learn vi enough to work with macros and such but you could
probably map it to a key like...

:map <F8> :s/^\(.*\)$/\/*\1*\//

and then just press F8 on the line where you want to put surrounding
comments on. I'm sure someone else has a better example for you.

Tom.
-- 
Thomas O'Dowd                   Have you had your noop today?
tom@example.com                  http://www.nooper.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links