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

Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #780 / 1624
  • Number of attempts: 2
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #50 / 254
  • Number of attempts: 2
quotes inside quotes - 3159 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 16
  • Position: #521 / 1078
  • Number of attempts: 2
Hanging Indent for Footnotes - 72 entries

Format this footnote (in kramdown syntax) so that it has hanging indent.

  • Best score: 17
  • Best player score: 25
  • Position: #17 / 30
  • Number of attempts: 2
Number an outline - 280 entries

The indent and words are right, but the numbers are all wrong.

  • Best score: 25
  • Best player score: 28
  • Position: #7 / 78
  • Number of attempts: 5
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 21
  • Position: #3333 / 3963
  • Number of attempts: 2
Pairs of numbers - 363 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 27
  • Position: #13 / 136
  • Number of attempts: 3
Assign list - 192 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 61
  • Position: #55 / 61
  • Number of attempts: 4
Draw the Go board - 149 entries

which is a 19×19 lines board. Here we use ascii characters only for simplicity. See diff file to get a sense. (See also http://en.wikipedia.org/wiki/Go_(game))

  • Best score: 50
  • Best player score: 61
  • Position: #15 / 51
  • Number of attempts: 1
paste indent correction - JS - 112 entries

You copy some javascript code from a website and paste it into vim, it does not look good!

  • Best score: 16
  • Best player score: 16
  • Position: #14 / 59
  • Number of attempts: 1
Hole-in-one - 1018 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 16
  • Position: #9 / 304
  • Number of attempts: 8
Delete unwanted lines - 411 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #16 / 229
  • Number of attempts: 1
Word frequency alignment - 290 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
  • Position: #68 / 161
  • Number of attempts: 1
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 32
  • Position: #39 / 174
  • Number of attempts: 10
Block Fun 1 - 210 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 24
  • Position: #57 / 75
  • Number of attempts: 1
Groups magic - 158 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: 15
  • Position: #80 / 93
  • Number of attempts: 2
Prefixes and suffixes - 635 entries

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

  • Best score: 17
  • Best player score: 28
  • Position: #121 / 201
  • Number of attempts: 4
Refactor arguments into object argument - 166 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 68
  • Position: #36 / 68
  • Number of attempts: 3
The name of the game - 665 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #112 / 360
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1606 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 8
  • Position: #25 / 446
  • Number of attempts: 5
Stairs Indenting - 473 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 13
  • Position: #40 / 197
  • Number of attempts: 3
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: 25
  • Position: #149 / 480
  • Number of attempts: 6
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 27
  • Position: #520 / 754
  • Number of attempts: 3
Exchanging Quotes - 858 entries

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

  • Best score: 30
  • Best player score: 35
  • Position: #98 / 230
  • 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: #453 / 777
  • Number of attempts: 5
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 16
  • Position: #596 / 663
  • Number of attempts: 2
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

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

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #160 / 1748
  • Number of attempts: 5
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #253 / 650
  • Number of attempts: 4
remove dupes from array - 1358 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 27
  • Position: #275 / 336
  • Number of attempts: 4
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Position: #125 / 652
  • Number of attempts: 9
Shebangs for all - 1999 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 17
  • Position: #347 / 516
  • Number of attempts: 5
Sort and add attributes - 1451 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 34
  • Position: #343 / 563
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3665 entries

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

  • Best score: 16
  • Best player score: 25
  • Position: #393 / 787
  • Number of attempts: 3
Flodder-challenge - 1262 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 38
  • Position: #220 / 335
  • Number of attempts: 2
Simple text editing with Vim - 12811 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #156 / 3694
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 6982 entries

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

  • Best score: 28
  • Best player score: 40
  • Position: #799 / 1706
  • Number of attempts: 9
Aaron Bieber
Twitter:

Massachusetts, USA

entered into 37 challenges

contributed 0 challenges