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

V to the i - 4751 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Position: #938 / 1879
  • Number of attempts: 3
Extract argument from function - 2314 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 17
  • Position: #554 / 744
  • Number of attempts: 2
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1303 / 1585
  • Number of attempts: 2
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1510 / 4164
  • Number of attempts: 5
Refactoring useless Method away - 91 entries

Real-life challenge, convert a bunch of ifs to a switch statement

  • Best score: 47
  • Best player score: 67
  • Position: #24 / 32
  • Number of attempts: 2
Condensed Cases - 788 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 12
  • Position: #17 / 242
  • Number of attempts: 7
Lisp Condense - 438 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 13
  • Position: #20 / 154
  • Number of attempts: 6
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1647 / 3666
  • Number of attempts: 7
Delete unwanted lines - 396 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #108 / 225
  • Number of attempts: 2
Word frequency alignment - 273 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 6
  • Position: #134 / 156
  • Number of attempts: 1
Prefixes and suffixes - 591 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 38
  • Position: #178 / 192
  • Number of attempts: 1
abcd > a b c d - 280 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #115 / 218
  • Number of attempts: 1
NATO phonetic alphabet - 501 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 19
  • Position: #16 / 191
  • Number of attempts: 10
The name of the game - 650 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #150 / 356
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1581 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #191 / 439
  • Number of attempts: 4
Saving the hashes(#) - 1992 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: 27
  • Position: #241 / 473
  • Number of attempts: 5
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #221 / 441
  • Number of attempts: 4
you're stuck on jQuery < 1.7 - 337 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

  • Best score: 25
  • Best player score: 32
  • Position: #75 / 111
  • Number of attempts: 3
replacing each line of a block selection - 2946 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #363 / 767
  • Number of attempts: 1
Append semicolon after expressions - 1005 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #311 / 403
  • Number of attempts: 2
Reverse and double space - 489 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 19
  • Position: #171 / 194
  • Number of attempts: 1
Remove noise from HTTP log - 695 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: 17
  • Position: #207 / 270
  • Number of attempts: 1
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #380 / 640
  • Number of attempts: 2
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #311 / 639
  • Number of attempts: 2
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #278 / 454
  • Number of attempts: 3
Increment, increment, increment.... - 662 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #270 / 401
  • Number of attempts: 1
Reconstruct the Sentence - 1363 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: 21
  • Position: #205 / 383
  • Number of attempts: 1
Simple text editing with Vim - 12281 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #2324 / 3580
  • Number of attempts: 2
Karun Ramakrishnan
Twitter:

Developer, Designer, Tester, Writer

entered into 28 challenges

contributed 0 challenges