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

V to the i - 4833 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #261 / 1904
  • Number of attempts: 3
SCREAMING_SNAKE_CASE to Title Case - 1269 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

  • Best score: 19
  • Best player score: 31
  • Position: #191 / 264
  • Number of attempts: 1
Add semicolons - 10923 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 15
  • Position: #2237 / 3087
  • Number of attempts: 1
Search and Replace 0 - 5042 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #961 / 1643
  • Number of attempts: 2
Just the middle - 11555 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 9
  • Position: #3384 / 4234
  • Number of attempts: 2
Make HTML List - 1061 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 50
  • Position: #202 / 274
  • Number of attempts: 1
Basic renumbering - 5707 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 19
  • Position: #730 / 1274
  • Number of attempts: 3
Add to end of each line... kinda - 339 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 13
  • Position: #126 / 176
  • Number of attempts: 1
Line under headers - 2087 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 30
  • Position: #278 / 513
  • Number of attempts: 1
Assign numbers to fields - 116 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 19
  • Position: #7 / 62
  • Number of attempts: 1
Swap assigned value - 671 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 12
  • Position: #206 / 259
  • Number of attempts: 2
Cartesian product - 267 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 38
  • Position: #80 / 100
  • Number of attempts: 2
Change your calendar - 397 entries

Happy New Year!

  • Best score: 18
  • Best player score: 39
  • Position: #71 / 88
  • Number of attempts: 1
VimGolfNight - 575 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #9 / 352
  • Number of attempts: 1
I forgot quotes - 16127 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2498 / 4208
  • Number of attempts: 1
-a-b-c- - 3225 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #904 / 1140
  • Number of attempts: 2
Where should I put the Newline? - 885 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 9
  • Position: #424 / 439
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10720 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1827 / 3703
  • Number of attempts: 1
Letter case trickery - 1644 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: 13
  • Position: #398 / 520
  • Number of attempts: 1
quotes inside quotes - 3185 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: #523 / 1086
  • Number of attempts: 2
Sort the VimGolf challenges by popularity - 348 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: 19
  • Position: #84 / 107
  • Number of attempts: 2
Words in parens - 13005 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1367 / 3979
  • Number of attempts: 2
Pairs of numbers - 364 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: 33
  • Position: #53 / 137
  • Number of attempts: 2
Hole-in-one - 1024 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: 19
  • Position: #160 / 305
  • Number of attempts: 3
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: 25
  • Position: #67 / 77
  • Number of attempts: 1
Word frequency alignment - 296 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: #71 / 163
  • Number of attempts: 2
A simple change - 476 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 14
  • Position: #92 / 196
  • Number of attempts: 1
The name of the game - 678 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #118 / 363
  • Number of attempts: 1
SFD-ROC: Pipe Dreams - 115 entries

Move the pipes so they match the output.

  • Best score: 12
  • Best player score: 21
  • Position: #44 / 47
  • Number of attempts: 1
Let's play some Ivmgolf - 1138 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #36 / 450
  • Number of attempts: 3
Vertical Limit - 2610 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #217 / 771
  • Number of attempts: 3
Append semicolon after expressions - 1061 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #314 / 421
  • Number of attempts: 1
switch variable - 5101 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1320 / 1756
  • Number of attempts: 1
The meaning - 577 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #191 / 364
  • Number of attempts: 1
remove dupes from array - 1361 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: 21
  • Position: #148 / 338
  • Number of attempts: 3
Numbering a List - 1941 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Position: #145 / 657
  • Number of attempts: 4
The holy-grail may help - 391 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #123 / 216
  • Number of attempts: 1
Ruby 1.9 hashes - 1277 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 16
  • Position: #297 / 413
  • Number of attempts: 1
A Simple One - 1070 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #333 / 673
  • Number of attempts: 1
Increment, increment, increment.... - 703 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #269 / 414
  • Number of attempts: 1
The Cake is a Lie - 1389 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #148 / 538
  • Number of attempts: 5
Context insensitive completion 0 - 594 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 9
  • Position: #205 / 251
  • Number of attempts: 1
Make Fancy Header - 1079 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 17
  • Position: #184 / 351
  • Number of attempts: 3
Change the content of a string - 1750 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #500 / 639
  • Number of attempts: 1
Sort and add attributes - 1557 entries

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

  • Best score: 33
  • Best player score: 34
  • Position: #364 / 601
  • Number of attempts: 3
Reconstruct the Sentence - 1697 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 21
  • Position: #228 / 445
  • Number of attempts: 1
Simple text editing with Vim - 13419 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1129 / 3846
  • Number of attempts: 3
A
Twitter:

entered into 47 challenges

contributed 0 challenges