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 - 33616 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: #502 / 7420
  • Number of attempts: 8
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #71 / 1268
  • Number of attempts: 7
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #46 / 3864
  • Number of attempts: 9
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #382 / 1893
  • Number of attempts: 4
Split line with dots - 2144 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 15
  • Position: #44 / 634
  • Number of attempts: 4
Extract argument from function - 2357 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #621 / 753
  • Number of attempts: 1
Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #447 / 1624
  • Number of attempts: 8
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #129 / 701
  • Number of attempts: 6
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #651 / 4197
  • Number of attempts: 4
Python Hello World! Reformatting - 994 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: 40
  • Position: #33 / 380
  • Number of attempts: 5
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #30 / 1264
  • Number of attempts: 6
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #192 / 2128
  • Number of attempts: 3
comments galore - 1045 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #183 / 424
  • Number of attempts: 4
Scrambled numbers - 807 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Position: #91 / 184
  • Number of attempts: 5
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #213 / 1190
  • Number of attempts: 7
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #413 / 4180
  • Number of attempts: 6
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #166 / 1137
  • Number of attempts: 7
Don't know what this is - 2022 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: #513 / 585
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #965 / 3683
  • Number of attempts: 3
quotes inside quotes - 3159 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: #238 / 1078
  • Number of attempts: 6
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #694 / 3963
  • Number of attempts: 4
The name of the game - 665 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #213 / 360
  • Number of attempts: 1
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: 8
  • Position: #79 / 446
  • Number of attempts: 10
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: 20
  • Position: #37 / 480
  • Number of attempts: 15
Exchanging Quotes - 858 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 30
  • Position: #5 / 230
  • Number of attempts: 11
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #126 / 663
  • Number of attempts: 4
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #427 / 1748
  • Number of attempts: 5
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #411 / 652
  • Number of attempts: 3
A Simple One - 1050 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: #435 / 664
  • Number of attempts: 1
Indentation - 542 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 20
  • Best player score: 21
  • Position: #7 / 178
  • Number of attempts: 7
The Cake is a Lie - 1346 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 12
  • Position: #488 / 527
  • Number of attempts: 4
Make Fancy Header - 1052 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 24
  • Position: #302 / 344
  • Number of attempts: 2
Change the content of a string - 1580 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #160 / 588
  • Number of attempts: 4
Sort and add attributes - 1451 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #198 / 563
  • Number of attempts: 3
Reconstruct the Sentence - 1507 entries

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

  • Best score: 20
  • Best player score: 20
  • Position: #95 / 412
  • Number of attempts: 2
Simple text editing with Vim - 12811 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #416 / 3694
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6982 entries

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

  • Best score: 28
  • Best player score: 32
  • Position: #145 / 1706
  • Number of attempts: 11
Ameen P
Twitter:

entered into 37 challenges

contributed 0 challenges