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

Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 13
  • Position: #570 / 1268
  • Number of attempts: 2
vim = 22 / 7 - 475 entries

pi square vim

  • Best score: 20
  • Best player score: 35
  • Position: #115 / 135
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 754 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #182 / 407
  • Number of attempts: 1
Search and Replace 0 - 4978 entries

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

  • Best score: 12
  • Best player score: 15
  • Position: #1094 / 1621
  • Number of attempts: 2
Just the middle - 11438 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 9
  • Position: #3445 / 4190
  • Number of attempts: 1
Greek Letters - 64 entries

Starting with a list of Greek letters, create a cross-reference table showing all of the Greek alpha-beta. You'll likely need to use digraphs (:help digraphs). Note that while most digraphs can be entered with either character first, lowercase sigma has two digraphs -- s* AND *s! Good luck!

  • Best score: 34
  • Best player score: 48
  • Position: #6 / 25
  • Number of attempts: 3
I forgot quotes - 15977 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2154 / 4177
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10657 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1658 / 3679
  • Number of attempts: 2
attr_aligner - 3502 entries

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

  • Best score: 19
  • Best player score: 33
  • Position: #509 / 697
  • Number of attempts: 1
Letter case trickery - 1624 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: 12
  • Position: #313 / 517
  • Number of attempts: 3
quotes inside quotes - 3158 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: 17
  • Position: #772 / 1077
  • Number of attempts: 1
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: 16
  • Position: #49 / 107
  • Number of attempts: 2
Words in parens - 12929 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2542 / 3961
  • Number of attempts: 4
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: 29
  • Position: #38 / 136
  • Number of attempts: 3
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: 21
  • Position: #54 / 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: 24
  • Position: #273 / 304
  • Number of attempts: 1
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: 23
  • Position: #48 / 77
  • Number of attempts: 3
Block Fun 1 - 210 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 22
  • Position: #42 / 75
  • Number of attempts: 2
abcd > a b c d - 291 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #98 / 222
  • Number of attempts: 1
The name of the game - 665 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #106 / 360
  • 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: 9
  • Position: #179 / 446
  • Number of attempts: 4
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: 30
  • Position: #367 / 480
  • Number of attempts: 4
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #190 / 445
  • Number of attempts: 3
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 28
  • Position: #571 / 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: 40
  • Position: #187 / 230
  • Number of attempts: 1
Switch function arguments - 2126 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #364 / 660
  • Number of attempts: 2
Append semicolon after expressions - 1054 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #187 / 418
  • Number of attempts: 1
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: #99 / 199
  • Number of attempts: 1
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: #66 / 273
  • 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: 8
  • Position: #204 / 263
  • Number of attempts: 2
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #744 / 1748
  • Number of attempts: 2
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #184 / 363
  • Number of attempts: 3
Make it more readable - 1993 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 18
  • Position: #511 / 648
  • Number of attempts: 2
remove dupes from array - 1354 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: #272 / 335
  • Number of attempts: 1
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #383 / 652
  • Number of attempts: 5
Shebangs for all - 1991 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: 15
  • Position: #264 / 514
  • Number of attempts: 4
A Simple One - 1045 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: #326 / 660
  • Number of attempts: 1
Change the content of a string - 1567 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 28
  • Position: #502 / 585
  • Number of attempts: 1
Sort and add attributes - 1436 entries

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

  • Best score: 33
  • Best player score: 34
  • Position: #338 / 559
  • Number of attempts: 1
Simple text editing with Vim - 12722 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1077 / 3675
  • Number of attempts: 4
curist
Twitter:

entered into 40 challenges

contributed 0 challenges