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

vim = 22 / 7 - 447 entries

pi square vim

  • Best score: 20
  • Best player score: 34
  • Position: #99 / 131
  • Number of attempts: 1
That hyphen - 2522 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #591 / 689
  • Number of attempts: 1
Python Hello World! Reformatting - 920 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: 44
  • Position: #215 / 359
  • Number of attempts: 1
Change your calendar - 349 entries

Happy New Year!

  • Best score: 18
  • Best player score: 27
  • Position: #36 / 82
  • Number of attempts: 1
I forgot quotes - 15840 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2360 / 4133
  • Number of attempts: 1
Words in parens - 12788 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2544 / 3930
  • Number of attempts: 1
199 Fibonacci Numbers - 37 entries

Generate 199 Fibonacci Numbers using, if you like, the function S(x,y), a vimscript to sum two big numbers in reverse order.

  • Best score: 51
  • Best player score: 117
  • Position: #16 / 16
  • Number of attempts: 1
Chinese Multiplication Table - 77 entries

Print a Chinese multiplication table in Vim. In China, every kid is asked to memorize this table. And thanks to the mono-syllabism of Chinese characters, it is not that hard. Printing the multiplication table is also a good exercise for programming beginners. For-loop, escaped characters, etc... There should be some special ways to print it in Vim.

  • Best score: 39
  • Best player score: 122
  • Position: #20 / 24
  • Number of attempts: 1
Prefixes and suffixes - 576 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #97 / 187
  • Number of attempts: 1
Refactor arguments into object argument - 160 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 68
  • Position: #31 / 64
  • Number of attempts: 1
Readable Rubyhash - 242 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: 27
  • Position: #28 / 90
  • Number of attempts: 1
Add links to an existing HTML table - 60 entries

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

  • Best score: 42
  • Best player score: 60
  • Position: #18 / 26
  • Number of attempts: 1
SFD-ROC: Tic-Tac-Toe - 132 entries

Tic-Tac-Toe You are 'X', and it is your turn. Stop 'O' from winning, and complete the game. Draw a diagonal line through your winning row of three X's.

  • Best score: 25
  • Best player score: 51
  • Position: #47 / 50
  • Number of attempts: 1
Extract text from xml - 106 entries

Extract text from xml file (ignoring commented out elements) and create a one line regex.

  • Best score: 28
  • Best player score: 45
  • Position: #30 / 43
  • Number of attempts: 1
The name of the game - 638 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #52 / 350
  • Number of attempts: 1
Stairs Indenting - 440 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 16
  • Position: #154 / 189
  • Number of attempts: 1
Unwrap the text of an email message - 180 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 26
  • Position: #55 / 71
  • Number of attempts: 1
Create an alphabet diamond - 76 entries

Here's a brain teaser to keep things interesting...

  • Best score: 40
  • Best player score: 79
  • Position: #22 / 29
  • Number of attempts: 1
Let's play some Ivmgolf - 1050 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Position: #329 / 429
  • Number of attempts: 2
Flip the chessboard - 77 entries

White's turn is over. Flip the board to black's perspective. I added coordinates to frustrate you.

  • Best score: 18
  • Best player score: 33
  • Position: #23 / 29
  • Number of attempts: 1
Vertical Limit - 2389 entries

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

  • Best score: 21
  • Best player score: 26
  • Position: #400 / 724
  • Number of attempts: 1
Exchanging Quotes - 800 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 40
  • Position: #177 / 220
  • Number of attempts: 1
Append semicolon after expressions - 975 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #168 / 394
  • Number of attempts: 1
Remove noise from HTTP log - 668 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: 23
  • Position: #249 / 264
  • Number of attempts: 1
switch variable - 4993 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1291 / 1722
  • Number of attempts: 1
Calculate the table totals - 123 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

  • Best score: 33
  • Best player score: 68
  • Position: #31 / 41
  • Number of attempts: 1
Multiplication table. - 195 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 83
  • Position: #42 / 63
  • Number of attempts: 1
Make it more readable - 1928 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #356 / 635
  • Number of attempts: 1
imports alignment (python) - 657 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 35
  • Position: #169 / 194
  • Number of attempts: 1
Shebangs for all - 1792 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: 24
  • Position: #431 / 473
  • Number of attempts: 1
Reverse Simple Deletion - 822 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #249 / 449
  • Number of attempts: 1
Make Fancy Header - 996 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 18
  • Position: #226 / 335
  • Number of attempts: 1
Reformat some Python - 573 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 53
  • Position: #180 / 226
  • Number of attempts: 1
Reverse characters in a line - 685 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: 13
  • Position: #49 / 245
  • Number of attempts: 4
Reformat most common surnames - 609 entries

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

  • Best score: 23
  • Best player score: 31
  • Position: #113 / 190
  • Number of attempts: 1
Get rid of html tags - 356 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #68 / 213
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3099 entries

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

  • Best score: 16
  • Best player score: 32
  • Position: #507 / 687
  • Number of attempts: 1
Simple text editing with Vim - 11856 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #2229 / 3469
  • Number of attempts: 1
Jason Wolf
Twitter:

entered into 38 challenges

contributed 0 challenges