Quick fix to add "+="

Fuming Wang fuming at sup.phys.washington.edu
Tue Apr 20 08:06:00 EDT 1999


Hi,

On 17 Apr 1999, Bernhard Reiter wrote:

> 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
> 

This works for me, except I got "no mapping found" when I enter the
suggested command. I am using vim 5.3. Is this the problem?

Thanks!
Fuming





More information about the Python-list mailing list