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

82 bottles of beer on the wall - 233 entries

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

  • Best score: 107
  • Best player score: 133
  • Number of attempts: 1
Remove Accent off the Letter - 100 entries

Remove all the accent from extremely accented statements.

  • Best score: 37
  • Best player score: 77
  • Number of attempts: 1
formatted text to markdown - 170 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
  • Number of attempts: 2
Sort and add attributes - 1037 entries

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

  • Best score: 18
  • Best player score: 33
  • Number of attempts: 5
Reformat some Python - 496 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 43
  • Number of attempts: 1
Letters are numbers - 121 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
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 5289 entries

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

  • Best score: 32
  • Best player score: 32
  • Number of attempts: 13
Table Reshuffle - 310 entries

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

  • Best score: 22
  • Best player score: 28
  • Number of attempts: 5
Complete the hex array data - 174 entries

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

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 4
Mess in revision history - 899 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 22
  • Number of attempts: 4
Reverse Simple Deletion - 681 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Increment, increment, increment.... - 458 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2433 entries

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

  • Best score: 16
  • Best player score: 25
  • Number of attempts: 3
Sort entries based on date - 292 entries

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

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Generate English Alphabets - 387 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 4
Change the content of a string - 1192 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Number of attempts: 4
Context insensitive completion 0 - 432 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: 7
  • Best player score: 7
  • Number of attempts: 3
Shebangs for all - 1542 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
  • Number of attempts: 2
Ruby 1.9 compat - 543 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
  • Number of attempts: 4
Ruby 1.9 hashes - 1023 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
  • Number of attempts: 5
Round Round - 199 entries

Round Round

  • Best score: 19
  • Best player score: 76
  • Number of attempts: 1
Line Zipper - 388 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
Sort the cardinal numbers - 203 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Multiplication table. - 168 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 53
  • Number of attempts: 2
Sorting paragraphs - 437 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 32
  • Number of attempts: 5
Make Fancy Header - 869 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 5
Reverse and count - 378 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
  • Number of attempts: 5
Reformat long lines - 305 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
  • Number of attempts: 2
Numbering a List - 1680 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Number of attempts: 3
The Cake is a Lie - 1097 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Simple text editing with Vim - 9723 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
The Universal Declaration of Human Rights, Article 1 - 127 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
  • Number of attempts: 2
Search and Replace 0 - 3766 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 7
Interweave two blocks of text - 468 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
  • Number of attempts: 3
Hatsuyume - 360 entries

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

  • Best score: 16
  • Best player score: 25
  • Number of attempts: 7
Words in parens - 10118 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 1
A Simple One - 799 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
  • Number of attempts: 2
Reconstruct the Sentence - 982 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
  • Number of attempts: 6
remove dupes from array - 1155 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
  • Number of attempts: 2
Complete the hex array data (Part II) - 123 entries

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

  • Best score: 20
  • Best player score: 22
  • Number of attempts: 1
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