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

Exchanging Quotes - 746 entries

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

  • Best score: 30
  • Best player score: 55
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 5391 entries

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

  • Best score: 32
  • Best player score: 45
  • Number of attempts: 1
Going underground.... - 283 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 29
  • Number of attempts: 1
Saving the hashes(#) - 1688 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
Enumerate words - 219 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 7
attr_aligner - 2847 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 4
NATO phonetic alphabet - 385 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 7
Shift down - 162 entries

Number words are back.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 3
SFD-ROC: ROT13 Phonics - 70 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 2
Delete unwanted lines - 333 entries

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

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Append semicolon after expressions - 841 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Where should I put the Newline? - 785 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Prefixes and suffixes - 485 entries

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

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 8
The meaning - 491 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 5
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: 22
  • Number of attempts: 3
quotes inside quotes - 2684 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: 2
  • Best player score: 14
  • Number of attempts: 5
Search and Replace 0 - 3921 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 9280 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Letter case trickery - 1416 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 4
Remove semicolons after expressions - 441 entries

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

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 3
Aligning function arguments to match a specific coding style - 151 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 3
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: 7
  • Number of attempts: 3
Make it more readable - 1719 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 7
Simple, Practical, and Common - 22762 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 2
  • Best player score: 26
  • Number of attempts: 6
Sort the cardinal numbers - 211 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
I forgot quotes - 10876 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 9
SFD-ROC: vimvimvim - 1257 entries

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

  • Best score: 8
  • Best player score: 15
  • Number of attempts: 1
Words in parens - 10646 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 6
Simple text editing with Vim - 10134 entries

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

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 10
Reverse and double space - 408 entries

Reverse the order of the given lines and double space everything

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

Align as one import per line.

  • Best score: 17
  • Best player score: 67
  • Number of attempts: 1
lamb had a little Mary - 464 entries

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

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 12
Basic renumbering - 4383 entries

Renumbering Basic.

  • Best score: 2
  • Best player score: 16
  • Number of attempts: 5

Contributed Challenges

Going underground.... - 283 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

retired account
Twitter:

entered into 33 challenges

contributed 1 challenges