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

Wget failed to download redirections - 250 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 32
  • Position: #68 / 73
  • Number of attempts: 2
V to the i - 4890 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #226 / 1917
  • Number of attempts: 2
Search and Replace 0 - 5170 entries

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

  • Best score: 7
  • Best player score: 12
  • Position: #393 / 1680
  • Number of attempts: 1
That hyphen - 2650 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #71 / 713
  • Number of attempts: 3
Just the middle - 11636 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1901 / 4262
  • Number of attempts: 2
Basic renumbering - 5735 entries

Renumbering Basic.

  • Best score: 7
  • Best player score: 14
  • Position: #403 / 1282
  • Number of attempts: 8
Restore order to the alphabet - 212 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 15
  • Position: #46 / 75
  • Number of attempts: 3
camel riding - 817 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 16
  • Position: #110 / 285
  • Number of attempts: 3
swap or reverse - 132 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Position: #31 / 72
  • Number of attempts: 2
Space out the alphabet - 1700 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Position: #173 / 460
  • Number of attempts: 4
remove all lines in first part - 226 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: #28 / 70
  • Number of attempts: 3
ASCII box - 379 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 27
  • Position: #75 / 112
  • Number of attempts: 2
Mute the second method of this script - 466 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 9
  • Position: #88 / 247
  • Number of attempts: 2
Condensed Cases - 829 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: 13
  • Position: #85 / 255
  • Number of attempts: 4
I forgot quotes - 16255 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1605 / 4229
  • Number of attempts: 2
-a-b-c- - 3243 entries

Put hyphens everywhere.

  • Best score: 6
  • Best player score: 15
  • Position: #579 / 1148
  • Number of attempts: 1
Gray area - 765 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #76 / 277
  • Number of attempts: 3
Don't know what this is - 2070 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 13
  • Position: #265 / 596
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10757 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #749 / 3717
  • Number of attempts: 3
quotes inside quotes - 3210 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: 7
  • Best player score: 15
  • Position: #459 / 1097
  • Number of attempts: 4
Hanging Indent for Footnotes - 92 entries

Format this footnote (in kramdown syntax) so that it has hanging indent.

  • Best score: 17
  • Best player score: 20
  • Position: #12 / 33
  • Number of attempts: 5
Words in parens - 13063 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #580 / 3995
  • Number of attempts: 2
NATO phonetic alphabet - 555 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Position: #99 / 202
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1643 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: #222 / 458
  • Number of attempts: 6
Stairs Indenting - 503 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #127 / 203
  • Number of attempts: 1
Let's play some Ivmgolf - 1167 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #286 / 462
  • Number of attempts: 1
Vertical Limit - 2642 entries

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

  • Best score: 10
  • Best player score: 26
  • Position: #486 / 781
  • Number of attempts: 1
Switch function arguments - 2235 entries

How to switch two arguments of a function.

  • Best score: 7
  • Best player score: 12
  • Position: #283 / 687
  • Number of attempts: 1
Append semicolon after expressions - 1088 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #231 / 427
  • Number of attempts: 2
Remove semicolons after expressions - 690 entries

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

  • Best score: 6
  • Best player score: 8
  • Position: #226 / 272
  • Number of attempts: 1
switch variable - 5136 entries

how fast can you switch two variable ?

  • Best score: 9
  • Best player score: 11
  • Position: #362 / 1767
  • Number of attempts: 4
Make it more readable - 2041 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #178 / 659
  • Number of attempts: 4
imports alignment (python) - 729 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 25
  • Position: #132 / 205
  • Number of attempts: 1
HTML to Haml - 906 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 30
  • Position: #58 / 208
  • Number of attempts: 7
Numbering a List - 1970 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 17
  • Position: #116 / 662
  • Number of attempts: 6
Reverse Simple Deletion - 875 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 15
  • Position: #432 / 467
  • Number of attempts: 1
Increment, increment, increment.... - 712 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #322 / 420
  • Number of attempts: 2
Context insensitive completion 0 - 611 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: 7
  • Position: #92 / 258
  • Number of attempts: 1
Reformat a C golf submission - 682 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 28
  • Position: #70 / 223
  • Number of attempts: 3
Reverse characters in a line - 848 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 8
  • Best player score: 15
  • Position: #154 / 285
  • Number of attempts: 1
Reformat most common surnames - 848 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 43
  • Position: #197 / 242
  • Number of attempts: 1
Add fold markers to a .c file - 748 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 27
  • Best player score: 38
  • Position: #152 / 205
  • Number of attempts: 1
Simple text editing with Vim - 13682 entries

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

  • Best score: 13
  • Best player score: 18
  • Position: #2764 / 3920
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 7737 entries

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

  • Best score: 7
  • Best player score: 34
  • Position: #329 / 1901
  • Number of attempts: 4
Skúli Jóhannsson
Twitter:

entered into 44 challenges

contributed 0 challenges