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

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

  • Best score: 7
  • Best player score: 8
  • Position: #924 / 1856
  • Number of attempts: 3
Extract argument from function - 2215 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #540 / 728
  • Number of attempts: 2
Search and Replace 0 - 4651 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1264 / 1541
  • Number of attempts: 2
Just the middle - 11136 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1484 / 4112
  • Number of attempts: 5
Refactoring useless Method away - 89 entries

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

  • Best score: 47
  • Best player score: 67
  • Position: #23 / 31
  • Number of attempts: 2
Condensed Cases - 752 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 / 230
  • Number of attempts: 7
Lisp Condense - 431 entries

Reduce 4 cons selection operations down to one function call.

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

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1626 / 3637
  • Number of attempts: 7
Delete unwanted lines - 358 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #108 / 215
  • Number of attempts: 2
Word frequency alignment - 241 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: #125 / 145
  • Number of attempts: 1
Prefixes and suffixes - 567 entries

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

  • Best score: 17
  • Best player score: 38
  • Position: #174 / 185
  • Number of attempts: 1
abcd > a b c d - 260 entries

transform the single spaces into 4 spaces repeat for each line

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

Transform the series of words into a list.

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

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #150 / 343
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1508 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: #185 / 424
  • Number of attempts: 4
Saving the hashes(#) - 1961 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: #238 / 466
  • Number of attempts: 5
Let's play some Ivmgolf - 1005 entries

Oops, I spelled that wrong.

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

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

  • Best score: 25
  • Best player score: 32
  • Position: #73 / 107
  • Number of attempts: 3
replacing each line of a block selection - 2791 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #349 / 732
  • Number of attempts: 1
Append semicolon after expressions - 942 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #298 / 385
  • Number of attempts: 2
Reverse and double space - 445 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 19
  • Position: #163 / 183
  • Number of attempts: 1
Remove noise from HTTP log - 660 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: #202 / 260
  • Number of attempts: 1
Make it more readable - 1891 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #370 / 622
  • Number of attempts: 2
Numbering a List - 1828 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #300 / 625
  • Number of attempts: 2
Reverse Simple Deletion - 758 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #270 / 429
  • Number of attempts: 3
Increment, increment, increment.... - 567 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #248 / 370
  • Number of attempts: 1
Reconstruct the Sentence - 1141 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: #185 / 346
  • Number of attempts: 1
Simple text editing with Vim - 11624 entries

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

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

Developer, Designer, Tester, Writer

entered into 28 challenges

contributed 0 challenges