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: #98 / 131
  • Number of attempts: 1
Search and Replace 0 - 4808 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #916 / 1591
  • Number of attempts: 2
Interweave two blocks of text - 641 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: 20
  • Position: #171 / 212
  • Number of attempts: 2
Python Hello World! Reformatting - 939 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: #218 / 365
  • Number of attempts: 2
Swap assigned value - 626 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Position: #214 / 250
  • Number of attempts: 2
Change your calendar - 362 entries

Happy New Year!

  • Best score: 18
  • Best player score: 43
  • Position: #79 / 85
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 345 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: 27
  • Position: #99 / 105
  • Number of attempts: 1
Words in parens - 12863 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 19
  • Position: #3009 / 3948
  • Number of attempts: 1
Parsing with CSV: Unify lines and result. - 165 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

  • Best score: 21
  • Best player score: 23
  • Position: #43 / 73
  • Number of attempts: 1
Minimalist Limerick - 517 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 39
  • Position: #120 / 172
  • Number of attempts: 2
Coordinates placeholder - 64 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 25
  • Position: #17 / 37
  • Number of attempts: 2
Define to require - 118 entries

When JSHint is enabled, there's a rule that doesn't let you have more than 6 arguments in a function, so the moment you need to add a 7th argument, you need to do a refactoring.

  • Best score: 62
  • Best player score: 89
  • Position: #31 / 48
  • Number of attempts: 1
Execute immediate SQL - 85 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 77
  • Position: #23 / 30
  • Number of attempts: 2
Circle in a square - 141 entries

Probably looks more like "Egg in a rectangle" in most fonts, but it's actually 23x23.

  • Best score: 23
  • Best player score: 72
  • Position: #45 / 53
  • Number of attempts: 1
Block Fun 1 - 189 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 35
  • Position: #68 / 73
  • Number of attempts: 1
Prefixes and suffixes - 598 entries

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

  • Best score: 17
  • Best player score: 32
  • Position: #159 / 194
  • Number of attempts: 1
Refactor arguments into object argument - 161 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 66
  • Position: #29 / 65
  • Number of attempts: 2
Sort by sum of numbers in a line(?) - 60 entries

The lines with the biggest sums need to be at the top. The sums are on the right, which makes life hard. Maybe you can find a feature that will do all the work for you...

  • Best score: 15
  • Best player score: 17
  • Position: #36 / 37
  • Number of attempts: 1
abcd > a b c d - 281 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #33 / 219
  • Number of attempts: 1
NATO phonetic alphabet - 501 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 25
  • Position: #156 / 191
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 169 entries

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

  • Best score: 24
  • Best player score: 30
  • Position: #93 / 101
  • Number of attempts: 1
Extract text from xml - 109 entries

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

  • Best score: 28
  • Best player score: 68
  • Position: #40 / 44
  • Number of attempts: 1
The name of the game - 650 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #84 / 356
  • Number of attempts: 3
lamb had a little Mary - 596 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 38
  • Position: #104 / 164
  • Number of attempts: 2
Stairs Indenting - 448 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Position: #141 / 193
  • Number of attempts: 1
Saving the hashes(#) - 2008 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: 30
  • Position: #356 / 476
  • Number of attempts: 1
Let's play some Ivmgolf - 1096 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #171 / 442
  • Number of attempts: 1
Vertical Limit - 2479 entries

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

  • Best score: 21
  • Best player score: 40
  • Position: #728 / 744
  • Number of attempts: 1
replacing each line of a block selection - 2947 entries

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

  • Best score: 18
  • Best player score: 23
  • Position: #444 / 768
  • Number of attempts: 1
Append semicolon after expressions - 1015 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #177 / 407
  • Number of attempts: 1
switch variable - 5041 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Position: #1468 / 1738
  • Number of attempts: 2
Calculate the table totals - 132 entries

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

  • Best score: 33
  • Best player score: 51
  • Position: #23 / 43
  • Number of attempts: 2
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #361 / 640
  • Number of attempts: 2
Line Zipper - 450 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #169 / 210
  • Number of attempts: 2
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 23
  • Position: #109 / 194
  • Number of attempts: 3
Ruby 1.9 hashes - 1221 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
  • Position: #214 / 401
  • Number of attempts: 4
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 16
  • Position: #430 / 454
  • Number of attempts: 2
Increment, increment, increment.... - 665 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #243 / 402
  • Number of attempts: 1
The Cake is a Lie - 1293 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #335 / 514
  • Number of attempts: 4
Simple text editing with Vim - 12353 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #1976 / 3597
  • Number of attempts: 1

Contributed Challenges

Prefixes and suffixes - 598 entries

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

Runar
Twitter:

Sec

entered into 40 challenges

contributed 1 challenges