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

Make Fancy Header - 928 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 22
  • Number of attempts: 1
remove dupes from array - 1258 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: 27
  • Number of attempts: 2
XML to JSON - 41 entries

Convert this xml file into json.

  • Best score: 75
  • Best player score: 99
  • Number of attempts: 4
REDRUM - 136 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

  • Best score: 14
  • Best player score: 18
  • Number of attempts: 3
HTML to Haml - 746 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 30
  • Number of attempts: 7
VimGolfNight - 469 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 1
Saving the hashes(#) - 1861 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: 25
  • Number of attempts: 6
Numbering a List - 1760 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Number of attempts: 7
Hanging Indent for Footnotes - 58 entries

Format this footnote (in kramdown syntax) so that it has hanging indent.

  • Best score: 17
  • Best player score: 21
  • Number of attempts: 2
Append semicolon after expressions - 892 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
paste indent correction - JS - 76 entries

You copy some javascript code from a website and paste it into vim, it does not look good!

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 3
Ruby 1.9 hashes - 1101 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: 18
  • Number of attempts: 2
NATO phonetic alphabet - 410 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 3
The Quick Brown Fox Jumps Over The Lazy Vim - 338 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 1
Dehamlizing - 155 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 43
  • Number of attempts: 1
Line Zipper - 401 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
PHP Array Syntax -> MailChimp Merge Syntax - 439 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 27
  • Number of attempts: 4
Context insensitive completion 0 - 453 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: 8
  • Number of attempts: 3
Whitespace, empty lines and tabs - 2715 entries

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

  • Best score: 16
  • Best player score: 30
  • Number of attempts: 1
Replacing some words - 401 entries

How fast could it be?

  • Best score: 17
  • Best player score: 20
  • Number of attempts: 2
Reverse and double space - 423 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 1
Execute immediate SQL - 82 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 70
  • Number of attempts: 2
Wrap the text of an email message to 79 characters - 512 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Interweave two blocks of text - 516 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
Groups magic - 136 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 1
Enumerate words - 225 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 27
  • Number of attempts: 2
Remove noise from HTTP log - 622 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: 16
  • Number of attempts: 4
Reverse and count - 382 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: 3
Word frequency alignment - 215 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: 5
  • Number of attempts: 2
Checkerboard case pattern - 107 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 27
  • Number of attempts: 1
Search and Replace 0 - 4434 entries

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

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 2
Get rid of html tags - 315 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 3
Refactor arguments into object argument - 158 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 71
  • Number of attempts: 1
Ugly spreadsheet copy/paste to CSV - 747 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 6
imports alignment (python) - 583 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 23
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1348 entries

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

  • Best score: 8
  • Best player score: 15
  • Number of attempts: 2
Sorting paragraphs - 443 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 38
  • Number of attempts: 1
PHP <--> Java class conversion Part 2 - 84 entries

Same class but reverse!

  • Best score: 80
  • Best player score: 106
  • Number of attempts: 2
Python Hello World! Reformatting - 857 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 43
  • Number of attempts: 1
Assign list - 146 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 31
  • Number of attempts: 5
Sort and add attributes - 1112 entries

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

  • Best score: 33
  • Best player score: 33
  • Number of attempts: 5
The name of the game - 594 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Reverse Simple Deletion - 732 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
Readable Rubyhash - 232 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: 23
  • Best player score: 30
  • Number of attempts: 1
Stairs Indenting - 384 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 3
Assignment Alignment - 716 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 26
  • Number of attempts: 1
Vertical Limit - 2230 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 28
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10091 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Delete unwanted lines - 347 entries

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

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 1
Reconstruct the Sentence - 1034 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: 10
Reformat/Refactor a Golfer Class - 5661 entries

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

  • Best score: 32
  • Best player score: 41
  • Number of attempts: 1
Words in parens - 11996 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 23
  • Number of attempts: 2
Reverse characters in a line - 601 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
Ruby 1.9 compat - 562 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: 21
  • Number of attempts: 1
you're stuck on jQuery < 1.7 - 324 entries

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

  • Best score: 25
  • Best player score: 29
  • Number of attempts: 4
Turn this csv list into queries - 190 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

  • Best score: 98
  • Best player score: 105
  • Number of attempts: 2
Top X - 182 entries

The End File is the Top 10 Vimgolf Leaderboard at June 29, 2013. This is a second version, with a great contribution of @udioica. X is ten in Roman,a numeric system in ancient Rome

  • Best score: 18
  • Best player score: 24
  • Number of attempts: 1
Shebangs for all - 1666 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: 16
  • Number of attempts: 2
Change the content of a string - 1266 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Number of attempts: 1
Swap assigned value - 505 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 5
Switch function arguments - 1884 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 4
Context Insensitive completion 1 - 397 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 1
replacing each line of a block selection - 2682 entries

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

  • Best score: 18
  • Best player score: 32
  • Number of attempts: 1
Make it more readable - 1797 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 19
  • Number of attempts: 1
Simple text editing with Vim - 11020 entries

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

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 3
Woojung Kim 김우중
Twitter:

entered into 65 challenges

contributed 0 challenges