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

Applying same text modification in several lines - 2623 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Com(m)a Trouble - 3108 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 3
Swap values inside brackets - 2336 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 2
Learn some german verbs - 450 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 32
  • Number of attempts: 2
Team names - 1718 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 2
multiple cursor alternative - 1375 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 20
  • Number of attempts: 5
From argument to object - 1232 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 18
  • Number of attempts: 3
Adam's challenge - 889 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 19
  • Number of attempts: 3
Order and join - 813 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 2
Every other line - 2712 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 6
One number per line - 17681 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 7
Swap values - 4313 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
Vice versa - 7222 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 5
Simple, Practical, and Common - 32041 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
  • Number of attempts: 2
Collect List - 4068 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Just the middle - 10901 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
Condensed Cases - 729 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
  • Number of attempts: 3
I forgot quotes - 15279 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 3
Basic renumbering - 5322 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
That hyphen - 2411 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 4
-a-b-c- - 3008 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
V to the i - 4526 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Subtraction - 155 entries

Solve the equations.

  • Best score: 18
  • Best player score: 36
  • Number of attempts: 1
Extract argument from function - 2146 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Mess in revision history - 1102 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 18
  • Number of attempts: 5
quotes inside quotes - 2973 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
  • Number of attempts: 4
Words in parens - 12460 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 4
Saving the hashes(#) - 1876 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: 21
  • Number of attempts: 7
SFD-ROC: vimvimvim - 1423 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Number of attempts: 7
Vertical Limit - 2264 entries

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

  • Best score: 21
  • Best player score: 22
  • Number of attempts: 8
switch variable - 4806 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 4
remove dupes from array - 1260 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: 18
  • Number of attempts: 2
Make Fancy Header - 929 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 1
Compile C - 287 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 20
  • Number of attempts: 5
Linear congruential generator - 104 entries

http://en.wikipedia.org/wiki/Linear_congruential_generator

  • Best score: 28
  • Best player score: 31
  • Number of attempts: 1
Python Hello World! Reformatting - 860 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
  • Number of attempts: 3
Search and Replace 0 - 4482 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
Change the content of a string - 1270 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 2
Reconstruct the Sentence - 1042 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: 21
  • Number of attempts: 6
Sort and add attributes - 1113 entries

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

  • Best score: 33
  • Best player score: 33
  • Number of attempts: 3
Whitespace, empty lines and tabs - 2733 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 9
Simple text editing with Vim - 11232 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5752 entries

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

  • Best score: 32
  • Best player score: 36
  • Number of attempts: 1
Brendan B Amdocs
Twitter:

entered into 43 challenges

contributed 0 challenges