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

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

  • Best score: 12
  • Best player score: 12
  • Position: #9 / 1621
  • Number of attempts: 7
Interweave two blocks of text - 659 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 17
  • Position: #79 / 214
  • Number of attempts: 3
Mess in revision history - 1183 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 22
  • Position: #121 / 249
  • Number of attempts: 4
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #362 / 3960
  • Number of attempts: 1
Multiplication table. - 232 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 53
  • Position: #24 / 68
  • Number of attempts: 2
Sort the cardinal numbers - 310 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 12
  • Position: #8 / 148
  • Number of attempts: 2
formatted text to markdown - 184 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

  • Best score: 70
  • Best player score: 76
  • Position: #25 / 67
  • Number of attempts: 2
Line Zipper - 472 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 12
  • Position: #7 / 214
  • Number of attempts: 4
remove dupes from array - 1354 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 17
  • Position: #5 / 335
  • Number of attempts: 2
Complete the hex array data - 197 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 23
  • Best player score: 25
  • Position: #18 / 74
  • Number of attempts: 4
Complete the hex array data (Part II) - 166 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 20
  • Best player score: 22
  • Position: #16 / 69
  • Number of attempts: 1
Sort entries based on date - 392 entries

Sort some entries in a Ledger-file based on date.

  • Best score: 11
  • Best player score: 11
  • Position: #13 / 117
  • Number of attempts: 3
Reformat long lines - 358 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

  • Best score: 15
  • Best player score: 17
  • Position: #49 / 134
  • Number of attempts: 2
Generate English Alphabets - 487 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Position: #36 / 206
  • Number of attempts: 4
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #179 / 652
  • Number of attempts: 3
The Universal Declaration of Human Rights, Article 1 - 163 entries

Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)

  • Best score: 24
  • Best player score: 24
  • Position: #4 / 71
  • Number of attempts: 2
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: 13
  • Position: #116 / 405
  • Number of attempts: 5
Shebangs for all - 1991 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: 15
  • Position: #239 / 514
  • 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: #14 / 660
  • Number of attempts: 2
Round Round - 299 entries

Round Round

  • Best score: 19
  • Best player score: 76
  • Position: #54 / 87
  • Number of attempts: 1
82 bottles of beer on the wall - 312 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

  • Best score: 106
  • Best player score: 133
  • Position: #83 / 145
  • Number of attempts: 1
Table Reshuffle - 410 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 28
  • Position: #44 / 138
  • Number of attempts: 5
Reverse and count - 473 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 24
  • Position: #50 / 176
  • Number of attempts: 5
Letters are numbers - 167 entries

Letters and numbers are interchangeable. A lot of programming languages give you simple ways to convert individual letters to hex, binary and decimal but does Vim?

  • Best score: 20
  • Best player score: 32
  • Position: #47 / 76
  • Number of attempts: 2
Ruby 1.9 compat - 627 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 16
  • Position: #121 / 233
  • Number of attempts: 4
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #64 / 458
  • Number of attempts: 1
Increment, increment, increment.... - 677 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #122 / 405
  • Number of attempts: 1
Sorting paragraphs - 514 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 32
  • Position: #87 / 161
  • Number of attempts: 5
Hatsuyume - 495 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 15
  • Best player score: 25
  • Position: #76 / 182
  • Number of attempts: 7
The Cake is a Lie - 1330 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #43 / 523
  • Number of attempts: 3
Context insensitive completion 0 - 566 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Position: #47 / 244
  • Number of attempts: 3
Remove Accent off the Letter - 126 entries

Remove all the accent from extremely accented statements.

  • Best score: 37
  • Best player score: 77
  • Position: #43 / 51
  • Number of attempts: 1
Make Fancy Header - 1046 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #8 / 343
  • Number of attempts: 5
Reformat some Python - 604 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 43
  • Position: #125 / 235
  • Number of attempts: 1
Change the content of a string - 1561 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #4 / 583
  • Number of attempts: 4
Sort and add attributes - 1433 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #21 / 557
  • Number of attempts: 5
Reconstruct the Sentence - 1487 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: 20
  • Position: #13 / 409
  • Number of attempts: 6
Whitespace, empty lines and tabs - 3591 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 25
  • Position: #376 / 776
  • Number of attempts: 3
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: 14
  • Position: #738 / 3671
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 6901 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 28
  • Best player score: 32
  • Position: #101 / 1690
  • Number of attempts: 13
Utkarsh Kukreti
Twitter:

Programmer. &lt;3 Programming Languages in general. Currently working with Node.js and Ruby. Experimenting with Rust. Edit: Haskell. Edit 2: Clojure.

entered into 40 challenges

contributed 0 challenges