January 15, 2010

vim tip #5: recording


I need to replace all those old-fashioned declarations.  Using vims recording here is how to do it.








qi           # rec into "i"
:,/{/s/;/,/  # sub ; w/ , to {
?(           # back to(
lD           # del stuff after
/{           # go to curly
k            # hop up a line
f,r)         # go , and rep w/ )
q            # stop recording

Now anytime you wanna do the same thing (the recording gets saved too)...

@i



1 comment:

Keith said...

Destroy == Waterfall, Redisplay == Come up for air, DisplayAccelerator == Rapids... Connect the dots... aah ooo ooo...