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

Swap values - 4610 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 16
  • Position: #1070 / 1267
  • Number of attempts: 2
Extract argument from function - 2355 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #556 / 752
  • Number of attempts: 2
Create Leading Zeros - 239 entries

Create leading zeros only for id columns. Please use generic approach!

  • Best score: 23
  • Best player score: 28
  • Position: #42 / 81
  • Number of attempts: 2
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 15
  • Position: #682 / 1190
  • Number of attempts: 4
VimGolfNight - 559 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 13
  • Position: #300 / 346
  • Number of attempts: 2
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Position: #5 / 354
  • Number of attempts: 3
Carriage return - 43 entries

I have some raw data from terminal output which uses carriege return for formatting. Carriage return sets the pointer to the first character on the line, and subsequent characters will overwrite what was there before. The challange is to simulate the terminal behaviour in vim. I'm kind of unsure if I should have skipped lines 9 and 15, since there might be some interesting solutions which are not that generic. Happy Golfing!

  • Best score: 22
  • Best player score: 38
  • Position: #19 / 21
  • Number of attempts: 1
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 27
  • Position: #3812 / 3960
  • Number of attempts: 1
Pairs of numbers - 363 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: 67
  • Position: #131 / 136
  • Number of attempts: 1
Hole-in-one - 1018 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 23
  • Position: #257 / 304
  • Number of attempts: 2
Delete unwanted lines - 408 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #83 / 228
  • Number of attempts: 3
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 38
  • Position: #115 / 174
  • Number of attempts: 1
Prefixes and suffixes - 629 entries

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

  • Best score: 17
  • Best player score: 38
  • Position: #180 / 196
  • Number of attempts: 1
Switch function arguments - 2123 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #71 / 658
  • Number of attempts: 9
Append semicolon after expressions - 1047 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #53 / 414
  • Number of attempts: 4
switch variable - 5068 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 16
  • Position: #1560 / 1747
  • Number of attempts: 2
Make it more readable - 1988 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #154 / 647
  • Number of attempts: 3
Ruby 1.9 hashes - 1239 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: 19
  • Position: #353 / 405
  • Number of attempts: 2
A Simple One - 1045 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: #346 / 660
  • Number of attempts: 1
The Cake is a Lie - 1330 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #429 / 523
  • Number of attempts: 1
Simple text editing with Vim - 12712 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #2034 / 3671
  • Number of attempts: 2
codegourmet
Twitter:

Kung fu & Software Engineering enthusiast.

entered into 21 challenges

contributed 0 challenges