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

HS exam question - 1523 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 60
  • Position: #113 / 404
  • Number of attempts: 1
Simple, Practical, and Common - 33483 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: 22
  • Position: #408 / 7384
  • Number of attempts: 11
One number per line - 18673 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #6 / 3852
  • Number of attempts: 7
vim = 22 / 7 - 451 entries

pi square vim

  • Best score: 20
  • Best player score: 20
  • Position: #3 / 133
  • Number of attempts: 2
Add semicolons - 10831 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #59 / 3055
  • Number of attempts: 3
Split line with dots - 2131 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 18
  • Position: #285 / 633
  • Number of attempts: 2
Box it - 7849 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 22
  • Position: #482 / 1870
  • Number of attempts: 6
Every other line - 2902 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #88 / 702
  • Number of attempts: 4
That hyphen - 2572 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #19 / 698
  • Number of attempts: 4
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #14 / 4174
  • Number of attempts: 6
C Reformatting - 689 entries

You may use Visual mode... or not. #uppercase

  • Best score: 30
  • Best player score: 33
  • Position: #52 / 162
  • Number of attempts: 3
A grid of punctuation - 127 entries

Create a checkerboard of = and - in an 80×24 grid!

  • Best score: 16
  • Best player score: 16
  • Position: #11 / 59
  • Number of attempts: 2
Generate a list of numbers - 284 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 14
  • Position: #11 / 137
  • Number of attempts: 2
VimGolfNight - 538 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #39 / 344
  • Number of attempts: 1
Test everything! - 163 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 42
  • Position: #47 / 53
  • Number of attempts: 3
Condensed Cases - 794 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: 14
  • Position: #109 / 244
  • Number of attempts: 2
I forgot quotes - 15946 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #7 / 4166
  • Number of attempts: 3
Shift down - 194 entries

Number words are back.

  • Best score: 19
  • Best player score: 19
  • Position: #6 / 68
  • Number of attempts: 3
-a-b-c- - 3183 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #39 / 1132
  • Number of attempts: 3
Count both ways - 1006 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #97 / 352
  • Number of attempts: 2
NBCU Weekly Challenge - Test - 244 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #30 / 115
  • Number of attempts: 2
Lisp Condense - 449 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 14
  • Position: #68 / 157
  • Number of attempts: 2
Gray area - 745 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 11
  • Position: #4 / 270
  • Number of attempts: 3
Winding path - 94 entries

It's a maze, but the bad paths have been blocked off. Mark the correct path.

  • Best score: 27
  • Best player score: 58
  • Position: #28 / 41
  • Number of attempts: 1
Don't know what this is - 1996 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: 12
  • Position: #163 / 581
  • Number of attempts: 4
Two become one - 713 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 30
  • Position: #84 / 208
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #87 / 3677
  • Number of attempts: 5
attr_aligner - 3454 entries

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

  • Best score: 19
  • Best player score: 33
  • Position: #508 / 695
  • Number of attempts: 3
Letter case trickery - 1598 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: 10
  • Position: #83 / 514
  • Number of attempts: 3
quotes inside quotes - 3128 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: #107 / 1073
  • Number of attempts: 5
Sort the VimGolf challenges by popularity - 346 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: #45 / 106
  • Number of attempts: 4
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #246 / 3950
  • Number of attempts: 3
A simple change - 444 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #79 / 190
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1594 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: #164 / 443
  • Number of attempts: 2
Saving the hashes(#) - 2008 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: 29
  • Position: #304 / 476
  • Number of attempts: 2
Reverse Simple Deletion - 834 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #253 / 455
  • Number of attempts: 1
Change the content of a string - 1502 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 24
  • Position: #317 / 567
  • Number of attempts: 2
Simple text editing with Vim - 12491 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2152 / 3626
  • Number of attempts: 1
Marcin Radomski
Twitter:

Programmer. Posts random stuff from all over the Internet.

entered into 38 challenges

contributed 0 challenges