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 - 33385 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: 31
  • Position: #5485 / 7364
  • Number of attempts: 3
One number per line - 18616 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 23
  • Position: #2890 / 3842
  • Number of attempts: 1
From argument to object - 1474 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
  • Position: #360 / 450
  • Number of attempts: 2
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 22
  • Position: #641 / 700
  • Number of attempts: 1
Extract argument from function - 2314 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #622 / 744
  • Number of attempts: 1
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 14
  • Position: #576 / 695
  • Number of attempts: 1
comment and uncomment code inline - 1069 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
  • Position: #241 / 314
  • Number of attempts: 1
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 15
  • Position: #4110 / 4164
  • Number of attempts: 1
Extract HTML option values from tag values - 98 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
  • Position: #34 / 42
  • Number of attempts: 1
Python Hello World! Reformatting - 938 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
  • Position: #65 / 364
  • Number of attempts: 8
Stairstep digits - 376 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #98 / 141
  • Number of attempts: 1
Vice versa - 7805 entries

Little role switching.

  • Best score: 12
  • Best player score: 17
  • Position: #1577 / 2101
  • Number of attempts: 1
Sort files from hosts - 179 entries

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

  • Best score: 15
  • Best player score: 18
  • Position: #62 / 74
  • Number of attempts: 1
Order and join - 956 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 14
  • Position: #207 / 255
  • Number of attempts: 3
comments galore - 998 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 11
  • Position: #357 / 418
  • Number of attempts: 1
Collect List - 4264 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 17
  • Position: #966 / 1186
  • Number of attempts: 1
VimGolfNight - 536 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #252 / 343
  • Number of attempts: 1
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 20
  • Position: #3599 / 4161
  • Number of attempts: 1
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #983 / 1129
  • Number of attempts: 1
Gray area - 732 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 15
  • Position: #246 / 268
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Position: #3121 / 3666
  • Number of attempts: 2
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 20
  • Position: #3266 / 3946
  • Number of attempts: 1
The name of the game - 650 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 12
  • Position: #313 / 356
  • Number of attempts: 2
Saving the hashes(#) - 1992 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
  • Position: #412 / 473
  • Number of attempts: 1
Remove noise from HTTP log - 695 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
  • Position: #112 / 270
  • Number of attempts: 3
switch variable - 5036 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1407 / 1736
  • Number of attempts: 2
The meaning - 558 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #267 / 356
  • Number of attempts: 1
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 93
  • Position: #640 / 640
  • Number of attempts: 1
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 26
  • Position: #561 / 639
  • Number of attempts: 1
Shebangs for all - 1912 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
  • Position: #461 / 500
  • Number of attempts: 1
A Simple One - 1001 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: #455 / 643
  • Number of attempts: 1
Make Fancy Header - 1014 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 23
  • Position: #284 / 338
  • Number of attempts: 1
Reconstruct the Sentence - 1369 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
  • Position: #215 / 384
  • Number of attempts: 2
Simple text editing with Vim - 12290 entries

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

  • Best score: 13
  • Best player score: 21
  • Position: #2806 / 3581
  • 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