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

Swap values inside brackets - 2140 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 2
Collect List - 3912 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1381 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
One number per line - 16544 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 7
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
Swap values - 4178 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
From argument to object - 1221 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
Extract argument from function - 2134 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
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
Order and join - 811 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 2
Python Hello World! Reformatting - 859 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 - 1113 entries

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

  • Best score: 33
  • Best player score: 33
  • Number of attempts: 3
switch variable - 4644 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 4
Just the middle - 10424 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
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
Applying same text modification in several lines - 2442 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
Every other line - 2525 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 6
That hyphen - 2389 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 4
V to the i - 4374 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Learn some german verbs - 421 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
Compile C - 280 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 20
  • Number of attempts: 5
Vertical Limit - 2242 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
Reformat/Refactor a Golfer Class - 5690 entries

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

  • Best score: 32
  • Best player score: 36
  • Number of attempts: 1
Words in parens - 12053 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 4
Whitespace, empty lines and tabs - 2728 entries

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

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 9
Vice versa - 6905 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 5
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
Com(m)a Trouble - 2788 entries

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

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 3
multiple cursor alternative - 1356 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
Reconstruct the Sentence - 1038 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
Simple, Practical, and Common - 30244 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
Subtraction - 147 entries

Solve the equations.

  • Best score: 18
  • Best player score: 36
  • Number of attempts: 1
Team names - 1637 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 2
I forgot quotes - 14449 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 3
Mess in revision history - 1074 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 18
  • Number of attempts: 5
Change the content of a string - 1267 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 2
Search and Replace 0 - 4444 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
quotes inside quotes - 2944 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
Basic renumbering - 5136 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Simple text editing with Vim - 11046 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
-a-b-c- - 2886 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Linear congruential generator - 104 entries

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

  • Best score: 28
  • Best player score: 31
  • Number of attempts: 1
Brendan B Amdocs
Twitter:

entered into 43 challenges

contributed 0 challenges