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

A Simple One - 860 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: 1
switch variable - 4773 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 227 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 3
The name of the game - 597 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
NATO phonetic alphabet - 429 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 23
  • Number of attempts: 1
Letter case trickery - 1481 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 4
That hyphen - 2411 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 4
Change name of a variable - 152 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
Reverse Simple Deletion - 736 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
VimGolfNight - 478 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Where should I put the Newline? - 830 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
-a-b-c- - 3004 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 2
Search and Replace 0 - 4479 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
PHP Array Syntax -> MailChimp Merge Syntax - 440 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: 29
  • Number of attempts: 1
Gray area - 669 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 2
Delete unwanted lines - 350 entries

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

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
Words in parens - 12372 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 1
Count both ways - 931 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 5734 entries

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

  • Best score: 32
  • Best player score: 42
  • Number of attempts: 2
Sort the VimGolf challenges by popularity - 319 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10330 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Make it more readable - 1818 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
NBCU Weekly Challenge - #0 - 124 entries

One of our favorites lines here at NBCU! p.s. The first version of #0 was deleted due to me copy/pasting a HTML entity. Congrats to the one who figured that out, you are a true ninja warrior!

  • Best score: 30
  • Best player score: 30
  • Number of attempts: 4
Groups magic - 140 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
Change the content of a string - 1270 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Number of attempts: 3
Shebangs for all - 1690 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: 13
  • Number of attempts: 4
Python Hello World! Reformatting - 859 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: 2
The Cake is a Lie - 1168 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 3
Swap assigned value - 525 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 2
Lisp Condense - 401 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 1
Increment, increment, increment.... - 525 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
V to the i - 4507 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Ruby 1.9 hashes - 1113 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: 14
  • Number of attempts: 1
Simple text editing with Vim - 11191 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 meaning - 515 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
learn vim in short time - 206 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1412 entries

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

  • Best score: 8
  • Best player score: 9
  • Number of attempts: 1
Jose Gutierrez
Twitter:

entered into 37 challenges

contributed 0 challenges