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

Python Hello World! Reformatting - 818 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
Sort and add attributes - 1052 entries

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

  • Best score: 18
  • Best player score: 33
  • Number of attempts: 3
Learn some german verbs - 326 entries

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

  • Best score: 11
  • Best player score: 32
  • Number of attempts: 2
Change the content of a string - 1204 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 2
Simple, Practical, and Common - 21245 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: 5
  • Best player score: 22
  • Number of attempts: 2
Vertical Limit - 2032 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
Saving the hashes(#) - 1686 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
Reconstruct the Sentence - 1004 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
Subtraction - 147 entries

Solve the equations.

  • Best score: 18
  • Best player score: 36
  • Number of attempts: 1
multiple cursor alternative - 892 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
Compile C - 275 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 20
  • Number of attempts: 5
From argument to object - 1008 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
Mess in revision history - 927 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 18
  • Number of attempts: 5
remove dupes from array - 1164 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 - 880 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2508 entries

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

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 9
Team names - 1227 entries

The team names are misspelled.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 2
One number per line - 10523 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 7
switch variable - 4095 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 12
  • Number of attempts: 4
V to the i - 3564 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Linear congruential generator - 104 entries

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

  • Best score: 28
  • Best player score: 31
  • Number of attempts: 1
Search and Replace 0 - 3841 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
-a-b-c- - 2368 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Basic renumbering - 4143 entries

Renumbering Basic.

  • Best score: 2
  • Best player score: 11
  • Number of attempts: 1
Swap values - 3155 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
Collect List - 3164 entries

Convert to comma separated list.

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

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1241 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
Extract argument from function - 1816 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
Vice versa - 5386 entries

Little role switching.

  • Best score: 2
  • Best player score: 13
  • Number of attempts: 5
Reformat/Refactor a Golfer Class - 5358 entries

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

  • Best score: 32
  • Best player score: 36
  • Number of attempts: 1
Every other line - 1806 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 6
Adam's challenge - 639 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
Com(m)a Trouble - 682 entries

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

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 3
Simple text editing with Vim - 9933 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
Order and join - 695 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 2
quotes inside quotes - 2647 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: 2
  • Best player score: 14
  • Number of attempts: 4
I forgot quotes - 10181 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 3
Words in parens - 10374 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 4
Condensed Cases - 667 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
Applying same text modification in several lines - 778 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
That hyphen - 1859 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 4
Swap values inside brackets - 866 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 2
Brendan B Amdocs
Twitter:

entered into 43 challenges

contributed 0 challenges