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

One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 24
  • Position: #3136 / 3864
  • Number of attempts: 1
V to the i - 4802 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 7
  • Position: #189 / 1893
  • Number of attempts: 3
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #213 / 4197
  • Number of attempts: 6
Interweave two blocks of text - 659 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 16
  • Position: #52 / 214
  • Number of attempts: 7
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #866 / 1264
  • Number of attempts: 3
comments galore - 1045 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #84 / 424
  • Number of attempts: 3
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 12
  • Position: #137 / 269
  • Number of attempts: 4
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #76 / 254
  • Number of attempts: 3
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 15
  • Position: #677 / 1190
  • Number of attempts: 4
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 19
  • Position: #252 / 281
  • Number of attempts: 2
swap or reverse - 126 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Position: #10 / 69
  • Number of attempts: 2
Logging with key - 328 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 39
  • Position: #77 / 88
  • Number of attempts: 2
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Position: #159 / 444
  • Number of attempts: 3
remove all lines in first part - 211 entries

From the second part, remove all lines in the first part. It can be useful when you have done something from a long list, you want to know what is not done yet!

  • Best score: 13
  • Best player score: 15
  • Position: #21 / 67
  • Number of attempts: 1
Fix the XML - 1039 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 40
  • Position: #278 / 290
  • Number of attempts: 2
Shuffled numbers - 246 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 15
  • Position: #8 / 96
  • Number of attempts: 2
Condensed Cases - 804 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 12
  • Position: #26 / 247
  • Number of attempts: 7
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1538 / 4180
  • Number of attempts: 4
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #551 / 1137
  • Number of attempts: 3
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 14
  • Position: #77 / 354
  • Number of attempts: 10
120 Degrees - 493 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #21 / 145
  • Number of attempts: 5
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #145 / 437
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #687 / 3683
  • Number of attempts: 6
attr_aligner - 3520 entries

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

  • Best score: 19
  • Best player score: 28
  • Position: #326 / 702
  • Number of attempts: 3
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: 16
  • Position: #462 / 518
  • Number of attempts: 1
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: #192 / 1078
  • Number of attempts: 3
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 24
  • Position: #3712 / 3963
  • Number of attempts: 3
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: 23
  • Position: #264 / 304
  • 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: 13
  • Position: #13 / 93
  • Number of attempts: 5
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: #69 / 446
  • Number of attempts: 8
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 12
  • Position: #398 / 445
  • Number of attempts: 1
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #274 / 663
  • Number of attempts: 4
Remove noise from HTTP log - 717 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #98 / 273
  • Number of attempts: 5
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #355 / 1748
  • Number of attempts: 3
Sort the cardinal numbers - 310 entries

Maybe a simple challenge.

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

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #67 / 650
  • Number of attempts: 5
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: 20
  • Position: #136 / 336
  • Number of attempts: 6
HTML to Haml - 878 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 46
  • Position: #154 / 204
  • Number of attempts: 1
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #406 / 652
  • Number of attempts: 2
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: 14
  • Position: #231 / 516
  • Number of attempts: 5
Reverse and count - 473 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 22
  • Position: #44 / 176
  • Number of attempts: 6
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #311 / 458
  • Number of attempts: 1
The Cake is a Lie - 1346 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #206 / 527
  • Number of attempts: 2
Make Fancy Header - 1052 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #99 / 344
  • Number of attempts: 7
Whitespace, empty lines and tabs - 3665 entries

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

  • Best score: 16
  • Best player score: 28
  • Position: #479 / 787
  • 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: 14
  • Position: #1428 / 3694
  • Number of attempts: 5
Evan Coleman
Twitter:

Freelance Mac/iOS Developer, Formerly @timehop, Aerospace Engineer, Student Pilot, Skier, Guitarist, Yankees, Knicks & Jets Fan.

entered into 46 challenges

contributed 0 challenges