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 - 475 entries

pi square vim

  • Best score: 20
  • Best player score: 34
  • Position: #102 / 135
  • Number of attempts: 1
Search and Replace 0 - 4978 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #937 / 1621
  • Number of attempts: 2
Interweave two blocks of text - 659 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: #173 / 214
  • Number of attempts: 2
Python Hello World! Reformatting - 989 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: #226 / 379
  • Number of attempts: 2
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Position: #217 / 254
  • Number of attempts: 2
Change your calendar - 392 entries

Happy New Year!

  • Best score: 18
  • Best player score: 43
  • Position: #81 / 87
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 348 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: #100 / 107
  • Number of attempts: 1
Words in parens - 12929 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 19
  • Position: #3021 / 3961
  • Number of attempts: 1
Parsing with CSV: Unify lines and result. - 179 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: #45 / 77
  • Number of attempts: 1
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 39
  • Position: #121 / 174
  • Number of attempts: 2
Coordinates placeholder - 73 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 25
  • Position: #18 / 38
  • Number of attempts: 2
Define to require - 127 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: #32 / 50
  • Number of attempts: 1
Execute immediate SQL - 90 entries

Sql string tranformation ...

  • Best score: 58
  • Best player score: 77
  • Position: #24 / 32
  • Number of attempts: 2
Circle in a square - 152 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: #46 / 54
  • Number of attempts: 1
Block Fun 1 - 210 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 35
  • Position: #70 / 75
  • Number of attempts: 1
Prefixes and suffixes - 629 entries

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

  • Best score: 17
  • Best player score: 32
  • Position: #160 / 196
  • Number of attempts: 1
Refactor arguments into object argument - 166 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 66
  • Position: #30 / 68
  • Number of attempts: 2
Sort by sum of numbers in a line(?) - 67 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: #38 / 39
  • Number of attempts: 1
abcd > a b c d - 291 entries

transform the single spaces into 4 spaces repeat for each line

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

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 25
  • Position: #159 / 196
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 193 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: #97 / 106
  • Number of attempts: 1
Extract text from xml - 127 entries

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

  • Best score: 28
  • Best player score: 68
  • Position: #42 / 46
  • Number of attempts: 1
The name of the game - 665 entries

End up with the name of the game.

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

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

  • Best score: 16
  • Best player score: 38
  • Position: #105 / 167
  • Number of attempts: 2
Stairs Indenting - 473 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Position: #144 / 197
  • Number of attempts: 1
Saving the hashes(#) - 2063 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: #360 / 480
  • Number of attempts: 1
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #173 / 445
  • Number of attempts: 1
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 40
  • Position: #737 / 754
  • Number of attempts: 1
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 23
  • Position: #450 / 777
  • Number of attempts: 1
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #181 / 419
  • Number of attempts: 1
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Position: #1474 / 1748
  • Number of attempts: 2
Calculate the table totals - 146 entries

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

  • Best score: 33
  • Best player score: 51
  • Position: #24 / 45
  • Number of attempts: 2
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #367 / 650
  • Number of attempts: 2
Line Zipper - 473 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #173 / 215
  • Number of attempts: 2
imports alignment (python) - 700 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 23
  • Position: #111 / 198
  • Number of attempts: 3
Ruby 1.9 hashes - 1244 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: #218 / 406
  • Number of attempts: 4
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 16
  • Position: #433 / 458
  • Number of attempts: 2
Increment, increment, increment.... - 684 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #246 / 406
  • Number of attempts: 1
The Cake is a Lie - 1339 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #342 / 525
  • Number of attempts: 4
Simple text editing with Vim - 12760 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #2033 / 3684
  • Number of attempts: 1

Contributed Challenges

Prefixes and suffixes - 629 entries

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

Runar
Twitter:

Sec

entered into 40 challenges

contributed 1 challenges