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

pi square vim

  • Best score: 20
  • Best player score: 34
  • Position: #103 / 136
  • Number of attempts: 1
Search and Replace 0 - 5159 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #967 / 1674
  • Number of attempts: 2
Interweave two blocks of text - 692 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: #175 / 217
  • Number of attempts: 2
Python Hello World! Reformatting - 1048 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: #236 / 398
  • Number of attempts: 2
Swap assigned value - 694 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Position: #225 / 263
  • Number of attempts: 2
Change your calendar - 421 entries

Happy New Year!

  • Best score: 18
  • Best player score: 43
  • Position: #83 / 89
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 369 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: #102 / 110
  • Number of attempts: 1
Words in parens - 13053 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 19
  • Position: #3044 / 3991
  • Number of attempts: 1
Parsing with CSV: Unify lines and result. - 198 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: #48 / 80
  • Number of attempts: 1
Minimalist Limerick - 539 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 39
  • Position: #122 / 177
  • Number of attempts: 2
Coordinates placeholder - 95 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 25
  • Position: #21 / 44
  • Number of attempts: 2
Define to require - 143 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: #33 / 52
  • Number of attempts: 1
Execute immediate SQL - 107 entries

Sql string tranformation ...

  • Best score: 58
  • Best player score: 77
  • Position: #26 / 34
  • Number of attempts: 2
Circle in a square - 193 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: #48 / 56
  • Number of attempts: 1
Block Fun 1 - 245 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 35
  • Position: #74 / 79
  • Number of attempts: 1
Prefixes and suffixes - 668 entries

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

  • Best score: 17
  • Best player score: 32
  • Position: #165 / 207
  • Number of attempts: 1
Refactor arguments into object argument - 181 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 66
  • Position: #31 / 69
  • Number of attempts: 2
Sort by sum of numbers in a line(?) - 75 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: #41 / 42
  • Number of attempts: 1
abcd > a b c d - 308 entries

transform the single spaces into 4 spaces repeat for each line

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

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 25
  • Position: #161 / 199
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 212 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: #101 / 110
  • Number of attempts: 1
Extract text from xml - 150 entries

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

  • Best score: 28
  • Best player score: 68
  • Position: #47 / 51
  • Number of attempts: 1
The name of the game - 696 entries

End up with the name of the game.

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

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

  • Best score: 16
  • Best player score: 38
  • Position: #110 / 179
  • Number of attempts: 2
Stairs Indenting - 502 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Position: #148 / 202
  • Number of attempts: 1
Saving the hashes(#) - 2116 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: #365 / 488
  • Number of attempts: 1
Let's play some Ivmgolf - 1162 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #179 / 459
  • Number of attempts: 1
Vertical Limit - 2637 entries

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

  • Best score: 21
  • Best player score: 40
  • Position: #759 / 778
  • Number of attempts: 1
replacing each line of a block selection - 3067 entries

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

  • Best score: 18
  • Best player score: 23
  • Position: #457 / 789
  • Number of attempts: 1
Append semicolon after expressions - 1086 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #183 / 426
  • Number of attempts: 1
switch variable - 5128 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Position: #1488 / 1764
  • Number of attempts: 2
Calculate the table totals - 169 entries

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

  • Best score: 33
  • Best player score: 51
  • Position: #26 / 48
  • Number of attempts: 2
Make it more readable - 2039 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #373 / 658
  • Number of attempts: 2
Line Zipper - 480 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #175 / 217
  • Number of attempts: 2
imports alignment (python) - 721 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 23
  • Position: #112 / 202
  • Number of attempts: 3
Ruby 1.9 hashes - 1312 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: #224 / 419
  • Number of attempts: 4
Reverse Simple Deletion - 874 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 16
  • Position: #441 / 466
  • Number of attempts: 2
Increment, increment, increment.... - 706 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #255 / 416
  • Number of attempts: 1
The Cake is a Lie - 1418 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 10
  • Position: #353 / 543
  • Number of attempts: 4
Simple text editing with Vim - 13626 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #2146 / 3902
  • Number of attempts: 1

Contributed Challenges

Prefixes and suffixes - 668 entries

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

Runar
Twitter:

Sec

entered into 40 challenges

contributed 1 challenges