Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d1b1b97c58eaa2a8a0002fc

Python Hello World! Reformatting

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

Start file
#!/usr/bin/python
import sys
a
= "Hello World!"
sys
.stdout.write(str(a[0]))
sys
.stdout.write(str(a[1]))
sys
.stdout.write(str(a[2]))
sys
.stdout.write(str(a[3]))
sys
.stdout.write(str(a[4]))
sys
.stdout.write(str(a[5]))
sys
.stdout.write(str(a[6]))
sys
.stdout.write(str(a[7]))
sys
.stdout.write(str(a[8]))
sys
.stdout.write(str(a[9]))
sys
.stdout.write(str(a[10]))
sys
.stdout.write(str(a[11]))
End file
#!/usr/bin/python
import sys
a
= "Hello World!"
for i in range(0, len(a)):
  sys
.stdout.write(str(a[i]))

View Diff

4,15c4,5
< sys.stdout.write(str(a[0]))
< sys.stdout.write(str(a[1]))
< sys.stdout.write(str(a[2]))
< sys.stdout.write(str(a[3]))
< sys.stdout.write(str(a[4]))
< sys.stdout.write(str(a[5]))
< sys.stdout.write(str(a[6]))
< sys.stdout.write(str(a[7]))
< sys.stdout.write(str(a[8]))
< sys.stdout.write(str(a[9]))
< sys.stdout.write(str(a[10]))
< sys.stdout.write(str(a[11]))
---
> for i in range(0, len(a)):
>   sys.stdout.write(str(a[i]))

Solutions by @raf_whispering:

Unlock 10 remaining solutions by signing in and submitting your own entry
Created by: @Ujjwol

383 active golfers, 1006 entries

Solutions by @raf_whispering:
42
#84 - space for rent / @raf_whispering

12/29/2010 at 05:16PM

43
#>142 - space for rent / @raf_whispering

12/29/2010 at 04:35PM

44
#>199 - space for rent / @raf_whispering

12/29/2010 at 04:33PM

47
#>314 - space for rent / @raf_whispering

12/29/2010 at 04:31PM

49
#>340 - space for rent / @raf_whispering

12/29/2010 at 04:29PM

50
#>350 - space for rent / @raf_whispering

12/29/2010 at 04:18PM

58
#>372 - space for rent / @raf_whispering

12/29/2010 at 04:12PM

62
#>376 - space for rent / @raf_whispering

12/29/2010 at 04:00PM

63
#>376 - space for rent / @raf_whispering

12/29/2010 at 03:52PM

88
#>382 - space for rent / @raf_whispering

12/29/2010 at 03:47PM