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

Simple, Practical, and Common - 34021 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: 28
  • Position: #4113 / 7517
  • Number of attempts: 5
Swap values - 4707 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 19
  • Position: #1172 / 1294
  • Number of attempts: 1
V to the i - 4885 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #202 / 1915
  • Number of attempts: 4
Add string initializers to an enum - 903 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 35
  • Position: #253 / 266
  • Number of attempts: 1
Add semicolons - 10956 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 12
  • Position: #1861 / 3098
  • Number of attempts: 3
Box it - 8003 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 35
  • Position: #1652 / 1901
  • Number of attempts: 2
Every other line - 2951 entries

AaAaAaA

  • Best score: 12
  • Best player score: 23
  • Position: #673 / 712
  • Number of attempts: 1
Extract argument from function - 2429 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 22
  • Position: #744 / 773
  • Number of attempts: 2
Search and Replace 0 - 5162 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #1022 / 1675
  • Number of attempts: 3
That hyphen - 2649 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #437 / 712
  • Number of attempts: 2
Just the middle - 11620 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2992 / 4258
  • Number of attempts: 7
Make HTML List - 1072 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 48
  • Position: #162 / 276
  • Number of attempts: 3
Python Hello World! Reformatting - 1052 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 42
  • Position: #127 / 400
  • Number of attempts: 2
Basic renumbering - 5737 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #884 / 1281
  • Number of attempts: 1
Create Leading Zeros - 277 entries

Create leading zeros only for id columns. Please use generic approach!

  • Best score: 23
  • Best player score: 47
  • Position: #69 / 89
  • Number of attempts: 2
Add to end of each line... kinda - 351 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: #134 / 181
  • Number of attempts: 1
Vice versa - 8021 entries

Little role switching.

  • Best score: 12
  • Best player score: 22
  • Position: #1937 / 2158
  • Number of attempts: 1
One to Ten - 2258 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 12
  • Position: #229 / 688
  • Number of attempts: 3
Separating firstname & lastname - 183 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 31
  • Position: #56 / 63
  • Number of attempts: 1
Collect List - 4342 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #38 / 1200
  • 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: 22
  • Position: #62 / 70
  • Number of attempts: 2
Fix the XML - 1052 entries

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

  • Best score: 18
  • Best player score: 33
  • Position: #265 / 292
  • Number of attempts: 1
Mute the second method of this script - 465 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 9
  • Position: #84 / 246
  • Number of attempts: 2
Custom McCarthy sequence - 65 entries

Generate the first one hundred and twenty numbers (starting with n=1). See here for some inspiration: http://en.wikipedia.org/wiki/McCarthy_91_function

  • Best score: 15
  • Best player score: 19
  • Position: #13 / 21
  • Number of attempts: 2
Sorting database text output - 236 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

  • Best score: 24
  • Best player score: 25
  • Position: #47 / 87
  • Number of attempts: 1
Pretty format for variable declarations - 188 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 13
  • Best player score: 22
  • Position: #64 / 70
  • Number of attempts: 1
Happy TvvO - 440 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #93 / 212
  • Number of attempts: 1
I forgot quotes - 16239 entries

Oops.

  • Best score: 10
  • Best player score: 18
  • Position: #3153 / 4225
  • 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: 16
  • Position: #499 / 596
  • Number of attempts: 1
Where should I put the Newline? - 912 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #146 / 451
  • Number of attempts: 3
Mess in revision history - 1238 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 27
  • Position: #171 / 260
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10758 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 14
  • Position: #2751 / 3717
  • Number of attempts: 1
Words in parens - 13054 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2668 / 3991
  • Number of attempts: 2
Hole-in-one - 1040 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: 20
  • Position: #201 / 307
  • Number of attempts: 3
Minimalist Limerick - 539 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 54
  • Position: #169 / 177
  • Number of attempts: 2
Stairs Indenting - 502 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 35
  • Position: #199 / 202
  • Number of attempts: 1
calculations - 343 entries

Complete these (weird) calculations.

  • Best score: 38
  • Best player score: 73
  • Position: #68 / 72
  • Number of attempts: 1
Vertical Limit - 2637 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #680 / 778
  • Number of attempts: 2
Reverse and double space - 511 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 22
  • Position: #192 / 202
  • Number of attempts: 1
switch variable - 5128 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 20
  • Position: #1680 / 1764
  • Number of attempts: 1
Numbering a List - 1969 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 29
  • Position: #605 / 661
  • Number of attempts: 1
The Cake is a Lie - 1418 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 10
  • Position: #379 / 543
  • Number of attempts: 3
Reformat some Python - 659 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 49
  • Position: #184 / 248
  • Number of attempts: 1
Reformat most common surnames - 837 entries

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

  • Best score: 23
  • Best player score: 34
  • Position: #158 / 239
  • Number of attempts: 2
Simple text editing with Vim - 13644 entries

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

  • Best score: 13
  • Best player score: 18
  • Position: #2754 / 3906
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 7694 entries

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

  • Best score: 7
  • Best player score: 44
  • Position: #1191 / 1893
  • Number of attempts: 3
Alex Bartol
Twitter:

entered into 46 challenges

contributed 0 challenges