From: bernhard at alpha1.csd.uwm.edu (Bernhard Reiter)
Date: 17 Apr 1999 04:57:37 GMT
Subject: Quick fix to add "+="
References: <3717AB14.2926AF76@mediaone.net> <slrn7hfd1v.or9.bwinton@tor.dhs.org> <3717EE20.41343593@mediaone.net>
Message-ID: <slrn7hg55v.q5o.bernhard@alpha1.csd.uwm.edu>
Content-Length: 1241
X-UID: 501                                                  

Your editor is your friend:

Just use a macro in your favorite editor, which grabs the left
word of the curser postion and expands it into
	<word>=<word>+
Trigger the macro with "+=" and you type excactly what you
always type, just the result is more python like.

For vim, the following does the trick (without the special word matching caps
new vim versions provide. the ":noh is for people using hlsearch in 
vim 5.x version.)


:map!^[:s/\([a-zA-Z_][a-zA-Z0-9_]*\)$/\1=\1+/^M:noh^MA

	Bernhard


On Fri, 16 Apr 1999 22:12:48 -0400, Fuming Wang <fmwang at mediaone.net> wrote:
>I have searched dejanews. They don't like the "+=" characters. Could you
>be more specific about how to modify the interpreter? I desperate
>here.:)

>Blake Winton wrote:
>> On Fri, 16 Apr 1999 17:26:44 -0400, Fuming Wang <fmwang at mediaone.net> wrote:
>> >Any one knows a quick fix to add "+=" function. I am really getting
>> >tired of typing long names twice.
>> 
>> += has been left out of the language for a good reason, and thus it's
>> probably not likely that there's an easy way to add it.  I think you
>> will have to recompile the interpreter to get it to do what you want,
>> and even then, I don't think that you really want what it would do.




