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

Simple, Practical, and Common - 33609 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: 22
  • Best player score: 26
  • Position: #3445 / 7415
  • Number of attempts: 6
Search and Replace 0 - 4978 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #244 / 1621
  • Number of attempts: 4
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 16
  • Position: #543 / 1264
  • Number of attempts: 5
I forgot quotes - 15977 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1448 / 4177
  • Number of attempts: 9
Shift down - 209 entries

Number words are back.

  • Best score: 19
  • Best player score: 19
  • Position: #11 / 69
  • Number of attempts: 3
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #38 / 437
  • Number of attempts: 3
Going underground.... - 350 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
  • Position: #50 / 127
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10658 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1655 / 3680
  • Number of attempts: 2
attr_aligner - 3511 entries

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

  • Best score: 19
  • Best player score: 21
  • Position: #194 / 698
  • Number of attempts: 4
Letter case trickery - 1630 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
  • Position: #191 / 518
  • Number of attempts: 4
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: 14
  • Position: #7 / 1078
  • Number of attempts: 5
Words in parens - 12929 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1196 / 3961
  • Number of attempts: 6
Delete unwanted lines - 411 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #48 / 229
  • Number of attempts: 2
Parsing with CSV: Unify lines and result. - 179 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
  • Position: #36 / 77
  • Number of attempts: 3
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: 7
  • Position: #152 / 161
  • Number of attempts: 3
Enumerate words - 254 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 25
  • Position: #17 / 91
  • Number of attempts: 7
Prefixes and suffixes - 629 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #7 / 196
  • Number of attempts: 8
NATO phonetic alphabet - 526 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Position: #84 / 195
  • Number of attempts: 7
lamb had a little Mary - 599 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #12 / 166
  • Number of attempts: 12
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: 15
  • Position: #393 / 446
  • Number of attempts: 1
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: #139 / 480
  • Number of attempts: 6
SFD-ROC: ROT13 Phonics - 101 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
  • Position: #28 / 73
  • Number of attempts: 2
Aligning function arguments to match a specific coding style - 247 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
  • Position: #36 / 71
  • 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: 55
  • Position: #224 / 230
  • Number of attempts: 2
Append semicolon after expressions - 1054 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #23 / 418
  • Number of attempts: 3
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 16
  • Position: #95 / 199
  • Number of attempts: 3
Remove semicolons after expressions - 654 entries

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

  • Best score: 6
  • Best player score: 6
  • Position: #40 / 263
  • Number of attempts: 3
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #132 / 363
  • Number of attempts: 5
Sort the cardinal numbers - 310 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Position: #114 / 148
  • Number of attempts: 1
Make it more readable - 1995 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #25 / 649
  • Number of attempts: 7
imports alignment (python) - 700 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 67
  • Position: #196 / 198
  • Number of attempts: 1
Simple text editing with Vim - 12744 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2161 / 3681
  • Number of attempts: 10
Reformat/Refactor a Golfer Class - 6937 entries

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

  • Best score: 28
  • Best player score: 45
  • Position: #1140 / 1699
  • Number of attempts: 1

Contributed Challenges

Going underground.... - 350 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