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

Make it more readable - 1703 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 93
  • Number of attempts: 1
Python Hello World! Reformatting - 812 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: 41
  • Number of attempts: 8
Saving the hashes(#) - 1666 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: 32
  • Number of attempts: 1
Simple, Practical, and Common - 20860 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: 31
  • Number of attempts: 3
Numbering a List - 1684 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 26
  • Number of attempts: 1
Make Fancy Header - 874 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 23
  • Number of attempts: 1
From argument to object - 991 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: 21
  • Number of attempts: 2
Reconstruct the Sentence - 995 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: 2
switch variable - 4069 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 14
  • Number of attempts: 2
Every other line - 1764 entries

AaAaAaA

  • Best score: 12
  • Best player score: 22
  • Number of attempts: 1
Stairstep digits - 193 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Number of attempts: 1
Simple text editing with Vim - 9868 entries

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

  • Best score: 13
  • Best player score: 21
  • Number of attempts: 1
comment and uncomment code inline - 621 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 12
  • Number of attempts: 1
Order and join - 660 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 3
Extract HTML option values from tag values - 73 entries

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

  • Best score: 34
  • Best player score: 38
  • Number of attempts: 1
Collect List - 3124 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 17
  • Number of attempts: 1
The meaning - 487 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Shebangs for all - 1550 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

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

"vim vi improved"

  • Best score: 9
  • Best player score: 14
  • Number of attempts: 1
I forgot quotes - 10039 entries

Oops.

  • Best score: 10
  • Best player score: 20
  • Number of attempts: 1
One number per line - 10275 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 23
  • Number of attempts: 1
VimGolfNight - 447 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Vice versa - 5300 entries

Little role switching.

  • Best score: 2
  • Best player score: 17
  • Number of attempts: 1
comments galore - 854 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 1
The name of the game - 572 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Remove noise from HTTP log - 583 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 3
Just the middle - 8429 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 15
  • Number of attempts: 1
A Simple One - 806 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
  • Number of attempts: 1
Words in parens - 10287 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 20
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 9017 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 2
Gray area - 602 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 1
Extract argument from function - 1791 entries

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

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
Sort files from hosts - 121 entries

Resume files by host. I hope you enjoy with this challenge

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 1
-a-b-c- - 2325 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
Brandon Height
Twitter:

I don't charge by the hour. I charge by the awesome. Which makes me expensive, but also - and this is critical - awesome. DevOps/Sys Eng, and Privacy Enthusiast

entered into 34 challenges

contributed 0 challenges