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

Prime Numbers - 282 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 53
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 5570 entries

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

  • Best score: 32
  • Best player score: 40
  • Number of attempts: 2
Sort and add attributes - 1101 entries

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

  • Best score: 33
  • Best player score: 33
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2604 entries

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

  • Best score: 16
  • Best player score: 31
  • Number of attempts: 2
Vertical Limit - 2168 entries

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

  • Best score: 21
  • Best player score: 27
  • Number of attempts: 2
Cartesian product - 201 entries

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

  • Best score: 24
  • Best player score: 61
  • Number of attempts: 1
Saving the hashes(#) - 1806 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: 27
  • Number of attempts: 3
Numbering a List - 1754 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 25
  • Number of attempts: 2
replacing each line of a block selection - 2604 entries

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

  • Best score: 18
  • Best player score: 23
  • Number of attempts: 3
Turn this csv list into queries - 189 entries

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

  • Best score: 98
  • Best player score: 123
  • Number of attempts: 1
Letter case trickery - 1451 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: 20
  • Number of attempts: 1
VimGolfNight - 463 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 19
  • Number of attempts: 1
Make Fancy Header - 923 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 19
  • Number of attempts: 1
Context Insensitive completion 1 - 395 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 2
quotes inside quotes - 2845 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: 14
  • Best player score: 17
  • Number of attempts: 1
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: 2
The name of the game - 588 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Python Hello World! Reformatting - 837 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: 45
  • Number of attempts: 1
Generate Fibonacci Numbers - 209 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 32
  • Number of attempts: 2
Append semicolon after expressions - 881 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Let's play some Ivmgolf - 946 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 2
Almost encrypted - 165 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 495 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
Braces or Brackets? - 635 entries

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

  • Best score: 34
  • Best player score: 47
  • Number of attempts: 1
The meaning - 504 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Generate English Alphabets - 413 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Number of attempts: 2
Remove semicolons after expressions - 465 entries

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

  • Best score: 6
  • Best player score: 8
  • Number of attempts: 2
Switch function arguments - 1857 entries

How to switch two arguments of a function.

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

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Swap assigned value - 500 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 274 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: 21
  • Number of attempts: 1
Reverse Simple Deletion - 722 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 2
switch variable - 4453 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1325 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: 2
Remove noise from HTTP log - 620 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: 4
Hatsuyume - 365 entries

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

  • Best score: 16
  • Best player score: 27
  • Number of attempts: 1
A Simple One - 849 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
Words in parens - 11444 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 3
Simple text editing with Vim - 10706 entries

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

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 4
Shebangs for all - 1643 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: 1
Remember FizzBuzz? - 537 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 97
  • Number of attempts: 2
The holy-grail may help - 301 entries

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

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 1
82 bottles of beer on the wall - 261 entries

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

  • Best score: 107
  • Best player score: 137
  • Number of attempts: 1
Make it more readable - 1775 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 2
Delete unwanted lines - 339 entries

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

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
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: 16
  • Number of attempts: 1
foo
Twitter:

entered into 46 challenges

contributed 0 challenges