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

PHP <--> Java class conversion Part 1 - 178 entries

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 81
  • Number of attempts: 6
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: 79
  • Number of attempts: 4
Pairs of numbers - 316 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: 39
  • Number of attempts: 4
Cleanining up 80 column concatenated text - 183 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

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

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

  • Best score: 18
  • Best player score: 33
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 5335 entries

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

  • Best score: 32
  • Best player score: 33
  • Number of attempts: 10
Python to Ruby - 188 entries

Convert this Python code to Ruby. NOTE: This program likely won't run.

  • Best score: 24
  • Best player score: 31
  • Number of attempts: 3
Indentation - 406 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 21
  • Best player score: 30
  • Number of attempts: 2
HTML to Haml - 665 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 27
  • Number of attempts: 8
Reformat a C golf submission - 464 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 23
  • Best player score: 27
  • Number of attempts: 8
Prefixes and suffixes - 464 entries

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

  • Best score: 17
  • Best player score: 26
  • Number of attempts: 2
Coordinates placeholder - 49 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 25
  • Number of attempts: 2
The Quick Brown Fox Jumps Over The Lazy Vim - 318 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: 10
  • Number of attempts: 4
Generate English Alphabets - 387 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Number of attempts: 2
The name of the game - 572 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Append semicolon after expressions - 821 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
Ruby 1.9 hashes - 1024 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: 12
  • Number of attempts: 4
Search and Replace 0 - 3819 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 6
Interweave two blocks of text - 472 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: 2
Swap values - 3076 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 7
switch variable - 4069 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 11
  • Number of attempts: 5
you're stuck on jQuery < 1.7 - 314 entries

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

  • Best score: 25
  • Best player score: 26
  • Number of attempts: 4
Remove semicolons after expressions - 425 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 3
Change the content of a string - 1195 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Number of attempts: 6
Line Zipper - 388 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 3
The meaning - 487 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 472 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
Simple text editing with Vim - 9868 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 9
Hatsuyume - 360 entries

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

  • Best score: 16
  • Best player score: 26
  • Number of attempts: 5
A HAPPY NEW YEAR 2014 ! - 9017 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
The Cake is a Lie - 1099 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 4
Insert a Markdown link - 377 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 6
Shebangs for all - 1550 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: 12
  • Number of attempts: 12
Make it more readable - 1703 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 5
SFD-ROC: vimvimvim - 1235 entries

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

  • Best score: 8
  • Best player score: 10
  • Number of attempts: 2
Reconstruct the Sentence - 995 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: 7
Almost encrypted - 164 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
I forgot quotes - 10039 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 7
Braces or Brackets? - 617 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 49
  • Number of attempts: 1
Just the middle - 8429 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Stairs Indenting - 357 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 3
Words in parens - 10287 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 13
Context insensitive completion 0 - 440 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: 4
Reformat most common surnames - 510 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 9
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: 14
  • Number of attempts: 5
quotes inside quotes - 2632 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 2
  • Best player score: 14
  • Number of attempts: 5
The Universal Declaration of Human Rights, Article 1 - 128 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: 28
  • Number of attempts: 1
Cartesian product - 201 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 26
  • Number of attempts: 6
Make Fancy Header - 874 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 4
The holy-grail may help - 292 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 140 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 25
  • Best player score: 29
  • Number of attempts: 1
Inconsistent real estate paste - 140 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 26
  • Number of attempts: 4
SFD-ROC: Pipe Dreams - 93 entries

Move the pipes so they match the output.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 3
Vice versa - 5300 entries

Little role switching.

  • Best score: 2
  • Best player score: 17
  • Number of attempts: 1
Deleting folded text - 274 entries

The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.

  • Best score: 17
  • Best player score: 20
  • Number of attempts: 3
Add links to an existing HTML table - 59 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

  • Best score: 42
  • Best player score: 48
  • Number of attempts: 2
imports alignment (python) - 570 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 6
Create a pandoc compatible table - 136 entries

In [this vimcast][1], a featured gist from Tim Pope shows how to quickly make a simple table structure. How fast can you convert it to pandoc's markdown style? [1]: http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

  • Best score: 32
  • Best player score: 32
  • Number of attempts: 6
Numbering a List - 1684 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Number of attempts: 9
Assignment Alignment - 650 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 7
Simple, Practical, and Common - 20860 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 5
  • Best player score: 22
  • Number of attempts: 10
replacing each line of a block selection - 2374 entries

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

  • Best score: 17
  • Best player score: 18
  • Number of attempts: 6
Flodder-challenge - 787 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 38
  • Number of attempts: 2
Whitespace, empty lines and tabs - 2488 entries

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

  • Best score: 16
  • Best player score: 19
  • Number of attempts: 8
Remove noise from HTTP log - 583 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: 15
  • Number of attempts: 2
Case preserving word replacement - 383 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 4
PHP Array Syntax -> MailChimp Merge Syntax - 407 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: 23
  • Number of attempts: 8
Switch function arguments - 1771 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 8
Vertical Limit - 1995 entries

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

  • Best score: 21
  • Best player score: 23
  • Number of attempts: 5
(Emile (Swarts))
Twitter:

I can't remember what's wrong

entered into 69 challenges

contributed 0 challenges