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

vim = 22 / 7 - 475 entries

pi square vim

  • Best score: 20
  • Best player score: 20
  • Position: #18 / 135
  • Number of attempts: 7
V to the i - 4798 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #31 / 1891
  • Number of attempts: 2
Extract argument from function - 2355 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #77 / 752
  • Number of attempts: 3
Create Leading Zeros - 239 entries

Create leading zeros only for id columns. Please use generic approach!

  • Best score: 23
  • Best player score: 29
  • Position: #46 / 81
  • Number of attempts: 2
Swap assigned value - 643 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #55 / 253
  • Number of attempts: 5
VimGolfNight - 559 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #114 / 346
  • Number of attempts: 1
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 24
  • Position: #190 / 300
  • Number of attempts: 2
Don't know what this is - 2014 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 14
  • Position: #295 / 582
  • Number of attempts: 2
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #98 / 437
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10657 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1861 / 3679
  • Number of attempts: 4
attr_aligner - 3498 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 33
  • Position: #504 / 696
  • Number of attempts: 1
Ninjas Leaderboard - 99 entries

The two lines in "Start file" has an obfuscated email address. Second line give an index (from 1 to 30) to the chars list of the first line, for example, the first char of email (n) is in position 25, second char (i) is in position 19 and s.o.

  • Best score: 25
  • Best player score: 25
  • Position: #2 / 41
  • Number of attempts: 3
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #157 / 3960
  • Number of attempts: 8
Hole-in-one - 1018 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 16
  • Position: #39 / 304
  • Number of attempts: 7
Delete unwanted lines - 408 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #101 / 228
  • Number of attempts: 2
Prefixes and suffixes - 629 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 17
  • Position: #8 / 196
  • Number of attempts: 10
abcd > a b c d - 290 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #114 / 221
  • Number of attempts: 1
A simple change - 461 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 14
  • Position: #97 / 191
  • Number of attempts: 1
Cleanining up 80 column concatenated text - 203 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 53
  • Position: #68 / 79
  • Number of attempts: 1
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #223 / 445
  • Number of attempts: 3
you're stuck on jQuery < 1.7 - 362 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

  • Best score: 25
  • Best player score: 25
  • Position: #9 / 113
  • Number of attempts: 7
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #220 / 754
  • Number of attempts: 5
Exchanging Quotes - 854 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 40
  • Position: #189 / 229
  • Number of attempts: 1
replacing each line of a block selection - 2998 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 18
  • Position: #50 / 776
  • Number of attempts: 13
Switch function arguments - 2123 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #80 / 658
  • Number of attempts: 7
Append semicolon after expressions - 1046 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #62 / 413
  • Number of attempts: 3
Remove noise from HTTP log - 717 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: #83 / 273
  • Number of attempts: 3
Remove semicolons after expressions - 654 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 8
  • Position: #211 / 263
  • Number of attempts: 1
switch variable - 5068 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #219 / 1747
  • Number of attempts: 9
The meaning - 574 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #209 / 362
  • Number of attempts: 1
Make it more readable - 1988 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #46 / 647
  • Number of attempts: 4
remove dupes from array - 1354 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: 17
  • Position: #53 / 335
  • Number of attempts: 10
Ruby 1.9 hashes - 1239 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 13
  • Position: #156 / 405
  • Number of attempts: 6
Assignment Alignment - 882 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 43
  • Position: #205 / 220
  • Number of attempts: 1
A Simple One - 1045 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: #354 / 660
  • Number of attempts: 1
Ruby 1.9 compat - 627 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 14
  • Position: #44 / 233
  • Number of attempts: 3
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Position: #15 / 458
  • Number of attempts: 3
Indentation - 534 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 20
  • Best player score: 33
  • Position: #141 / 177
  • Number of attempts: 1
The Cake is a Lie - 1330 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #348 / 523
  • Number of attempts: 6
Make Fancy Header - 1046 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #79 / 343
  • Number of attempts: 3
Change the content of a string - 1561 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #120 / 583
  • Number of attempts: 4
Reconstruct the Sentence - 1484 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: 26
  • Position: #353 / 408
  • Number of attempts: 2
Stefan Schmidt
Twitter:

entered into 42 challenges

contributed 0 challenges