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

Chinese Multiplication Table - 50 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: 116
  • Number of attempts: 1
LaTeX to XML Math Delimiters - 35 entries

Vim is amazing when used to edit MediaWiki text, but typing "<math> . . . </math>" can be tiresome and frustrating if formulas are used often. LaTeX delimiters are so concise and even come in two flavors: "\( . . . \)" for inline math and "\[ . . . \]" for centered formulas. The goal is to perform the following conversions: "\( . . . \)" becomes "<math>. . .</math>" "\[ . . . \]" becomes "<center><math>. . .</math></center>"

  • Best score: 63
  • Best player score: 87
  • Number of attempts: 1
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: 52
  • Number of attempts: 2
Minimalist Limerick - 481 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 36
  • Number of attempts: 3
Prefixes and suffixes - 506 entries

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

  • Best score: 17
  • Best player score: 30
  • Number of attempts: 1
Swap assigned value - 499 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 330 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 1
Let's play some Ivmgolf - 937 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 2
vim = 22 / 7 - 398 entries

pi square vim

  • Best score: 20
  • Best player score: 39
  • Number of attempts: 3
Word frequency alignment - 198 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 6
  • Number of attempts: 1
Groups magic - 136 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • 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
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
Execute immediate SQL - 77 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 85
  • Number of attempts: 1
Refactor arguments into object argument - 157 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 68
  • Number of attempts: 2
Unwrap the text of an email message - 150 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: 16
  • Number of attempts: 2
NATO phonetic alphabet - 407 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 3
lamb had a little Mary - 499 entries

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

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

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 26
  • Number of attempts: 1
Saving the hashes(#) - 1794 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
Christopher Harrison
Twitter:

Proving Seligman right...

entered into 20 challenges

contributed 0 challenges