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

Circle in a square - 125 entries

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

  • Best score: 23
  • Best player score: 72
  • Number of attempts: 1
Calculate the table totals - 105 entries

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

  • Best score: 33
  • Best player score: 51
  • Number of attempts: 2
Change your calendar - 263 entries

Happy New Year!

  • Best score: 18
  • Best player score: 43
  • Number of attempts: 1
Execute immediate SQL - 77 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 77
  • Number of attempts: 2
Vertical Limit - 2148 entries

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

  • Best score: 21
  • Best player score: 40
  • Number of attempts: 1
Extract text from xml - 101 entries

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

  • Best score: 28
  • Best player score: 68
  • Number of attempts: 1
Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 35
  • Number of attempts: 1
vim = 22 / 7 - 398 entries

pi square vim

  • Best score: 20
  • Best player score: 34
  • Number of attempts: 1
Define to require - 113 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
  • Number of attempts: 1
Saving the hashes(#) - 1786 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
  • Number of attempts: 1
switch variable - 4385 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 2
Swap assigned value - 499 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Number of attempts: 2
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: 44
  • Number of attempts: 2
Prefixes and suffixes - 506 entries

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

  • Best score: 17
  • Best player score: 32
  • Number of attempts: 1
Append semicolon after expressions - 875 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Ruby 1.9 hashes - 1080 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
  • Number of attempts: 4
Parsing with CSV: Unify lines and result. - 162 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
  • Number of attempts: 1
Refactor arguments into object argument - 157 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 66
  • Number of attempts: 2
SFD-ROC: The Quick Brown Fox - 140 entries

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

  • Best score: 25
  • Best player score: 30
  • Number of attempts: 1
Simple text editing with Vim - 10600 entries

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

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 1
Let's play some Ivmgolf - 927 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 1
The Cake is a Lie - 1136 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 4
Search and Replace 0 - 4187 entries

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

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 2
Interweave two blocks of text - 498 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
  • Number of attempts: 2
The name of the game - 586 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
NATO phonetic alphabet - 407 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 25
  • Number of attempts: 1
Increment, increment, increment.... - 492 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
Words in parens - 11277 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 1
Stairs Indenting - 360 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 1
abcd > a b c d - 241 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 1
Coordinates placeholder - 52 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 25
  • Number of attempts: 2
Make it more readable - 1765 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 2
Sort the VimGolf challenges by popularity - 268 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
  • Number of attempts: 1
Sort by sum of numbers in a line(?) - 45 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
  • Number of attempts: 1
Reverse Simple Deletion - 720 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 2
Line Zipper - 397 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 2
lamb had a little Mary - 497 entries

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

  • Best score: 16
  • Best player score: 38
  • Number of attempts: 2
imports alignment (python) - 577 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 23
  • Number of attempts: 3
Minimalist Limerick - 481 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 39
  • Number of attempts: 2
replacing each line of a block selection - 2569 entries

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

  • Best score: 18
  • Best player score: 23
  • Number of attempts: 1

Contributed Challenges

Prefixes and suffixes - 506 entries

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

Runar
Twitter:

Sec

entered into 40 challenges

contributed 1 challenges