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 [challenge ID]

Played Challenges

Search and Replace 0 - 4681 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 16
  • Position: #1105 / 1550
  • Number of attempts: 1
Python Hello World! Reformatting - 906 entries

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.

  • Best score: 39
  • Best player score: 44
  • Position: #215 / 352
  • Number of attempts: 1
Swap assigned value - 561 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 12
  • Position: #189 / 236
  • Number of attempts: 1
VimGolfNight - 505 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #14 / 330
  • Number of attempts: 2
Letter case trickery - 1553 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 16
  • Position: #437 / 500
  • Number of attempts: 2
quotes inside quotes - 3030 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 17
  • Position: #668 / 1045
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 338 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

  • Best score: 15
  • Best player score: 19
  • Position: #82 / 102
  • Number of attempts: 4
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1894 / 3919
  • Number of attempts: 2
Pairs of numbers - 345 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 45
  • Position: #102 / 129
  • Number of attempts: 1
Delete unwanted lines - 358 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 11
  • Position: #196 / 215
  • Number of attempts: 2
abcd > a b c d - 263 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #102 / 207
  • Number of attempts: 1
NATO phonetic alphabet - 479 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 25
  • Position: #151 / 182
  • Number of attempts: 3
A simple change - 401 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 17
  • Position: #154 / 177
  • Number of attempts: 2
The Quick Brown Fox Jumps Over The Lazy Vim - 388 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 11
  • Position: #117 / 180
  • Number of attempts: 4
The name of the game - 629 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #121 / 344
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1510 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 14
  • Position: #331 / 424
  • Number of attempts: 1
Stairs Indenting - 428 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #100 / 184
  • Number of attempts: 2
Saving the hashes(#) - 1966 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 30
  • Position: #361 / 467
  • Number of attempts: 3
Let's play some Ivmgolf - 1015 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #183 / 420
  • Number of attempts: 2
Exchanging Quotes - 799 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 46
  • Position: #203 / 219
  • Number of attempts: 1
replacing each line of a block selection - 2816 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 34
  • Position: #681 / 736
  • Number of attempts: 1
Switch function arguments - 1985 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #438 / 628
  • Number of attempts: 2
Append semicolon after expressions - 958 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #178 / 388
  • Number of attempts: 3
Reverse and double space - 452 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 16
  • Position: #95 / 185
  • Number of attempts: 2
Remove noise from HTTP log - 665 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #70 / 262
  • Number of attempts: 3
switch variable - 4945 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Position: #1453 / 1708
  • Number of attempts: 1
The meaning - 523 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 6
  • Position: #317 / 338
  • Number of attempts: 1
Make it more readable - 1905 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #246 / 625
  • Number of attempts: 3
imports alignment (python) - 648 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 24
  • Position: #118 / 192
  • Number of attempts: 2
Numbering a List - 1832 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 25
  • Position: #506 / 627
  • Number of attempts: 1
Ruby 1.9 hashes - 1172 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 14
  • Position: #210 / 386
  • Number of attempts: 2
Shebangs for all - 1777 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 22
  • Position: #409 / 468
  • Number of attempts: 3
A Simple One - 934 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #336 / 617
  • Number of attempts: 1
Reverse Simple Deletion - 772 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 15
  • Position: #399 / 432
  • Number of attempts: 1
The Cake is a Lie - 1215 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #405 / 491
  • Number of attempts: 1
Make Fancy Header - 978 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Position: #176 / 329
  • Number of attempts: 4
Reformat most common surnames - 593 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 28
  • Position: #84 / 187
  • Number of attempts: 2
Change the content of a string - 1354 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #323 / 522
  • Number of attempts: 1
Sort and add attributes - 1211 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 37
  • Position: #389 / 490
  • Number of attempts: 2
Reconstruct the Sentence - 1160 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 20
  • Best player score: 25
  • Position: #285 / 348
  • Number of attempts: 2
Flodder-challenge - 927 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 39
  • Position: #195 / 273
  • Number of attempts: 1
Simple text editing with Vim - 11657 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 17
  • Position: #2212 / 3418
  • Number of attempts: 5
Bart of Denver
Twitter:

Open Source Geek, Biker, Gardener, Star Fleet Phony

entered into 42 challenges

contributed 0 challenges