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

Execute immediate SQL - 72 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 72
  • Number of attempts: 5
199 Fibonacci Numbers - 35 entries

Generate 199 Fibonacci Numbers using, if you like, the function S(x,y), a vimscript to sum two big numbers in reverse order.

  • Best score: 51
  • Best player score: 69
  • Number of attempts: 3
Extended Customer 2 - 39 entries

Format the chars

  • Best score: 47
  • Best player score: 61
  • Number of attempts: 5
Fibonacci Triangles - 40 entries

Triangles

  • Best score: 40
  • Best player score: 45
  • Number of attempts: 2
Minimalist Limerick - 441 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 39
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5335 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 39
  • Number of attempts: 2
Groups magic - 134 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
Exchanging Quotes - 725 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 32
  • Number of attempts: 3
Refactor arguments into object argument - 156 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 58
  • Number of attempts: 10
Simple text editing with Vim - 9863 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Stairs Indenting - 357 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 2
Restore order to the alphabet - 149 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 26
  • Number of attempts: 3
switch variable - 4069 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 11
  • Number of attempts: 2
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: 117
  • Number of attempts: 7
REDRUM - 131 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 4
Swap assigned value - 482 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Sort the VimGolf challenges by popularity - 241 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: 16
  • Number of attempts: 3
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: 26
  • Number of attempts: 7
A HAPPY NEW YEAR 2014 ! - 9012 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Coordinates placeholder - 49 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 26
  • Number of attempts: 1
lamb had a little Mary - 449 entries

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

  • Best score: 16
  • Best player score: 31
  • Number of attempts: 4
Word frequency alignment - 195 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: 5
  • Number of attempts: 1
Just the middle - 8425 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
Assignment Alignment - 650 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 2
Saving the hashes(#) - 1660 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: 25
  • Number of attempts: 6
Remove semicolons after expressions - 425 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 1
Change your calendar - 189 entries

Happy New Year!

  • Best score: 18
  • Best player score: 21
  • Number of attempts: 6
It's a factor - 75 entries

Flaunt your macro prowess by factoring some numbers. Too hard? It takes less than 30 strokes, I promise.

  • Best score: 25
  • Best player score: 92
  • Number of attempts: 2
Prefixes and suffixes - 464 entries

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

  • Best score: 17
  • Best player score: 22
  • Number of attempts: 7
Whitespace, empty lines and tabs - 2488 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 27
  • Number of attempts: 2
Parsing with CSV: Unify lines and result. - 157 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: 22
  • Number of attempts: 3
Joel Elkins
Twitter:

entered into 31 challenges

contributed 0 challenges