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

V to the i - 4641 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #885 / 1857
  • Number of attempts: 1
Search and Replace 0 - 4676 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #351 / 1549
  • Number of attempts: 1
That hyphen - 2500 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Position: #281 / 683
  • Number of attempts: 4
Python Hello World! Reformatting - 906 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: 43
  • Position: #164 / 352
  • Number of attempts: 2
Swap assigned value - 561 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #156 / 236
  • Number of attempts: 2
VimGolfNight - 497 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #195 / 328
  • Number of attempts: 1
learn vim in short time - 219 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #31 / 150
  • Number of attempts: 1
-a-b-c- - 3118 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #475 / 1112
  • Number of attempts: 2
Count both ways - 962 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #161 / 342
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 233 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #37 / 112
  • Number of attempts: 3
Change name of a variable - 163 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Position: #77 / 127
  • Number of attempts: 1
Lisp Condense - 432 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 14
  • Position: #74 / 152
  • Number of attempts: 1
Gray area - 702 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Position: #184 / 260
  • Number of attempts: 2
NBCU Weekly Challenge - #0 - 124 entries

One of our favorites lines here at NBCU! p.s. The first version of #0 was deleted due to me copy/pasting a HTML entity. Congrats to the one who figured that out, you are a true ninja warrior!

  • Best score: 30
  • Best player score: 30
  • Position: #16 / 55
  • Number of attempts: 4
Where should I put the Newline? - 845 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #310 / 422
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10538 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1876 / 3638
  • Number of attempts: 2
Letter case trickery - 1553 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 11
  • Position: #251 / 500
  • Number of attempts: 4
Sort the VimGolf challenges by popularity - 338 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

  • Best score: 15
  • Best player score: 16
  • Position: #52 / 102
  • Number of attempts: 2
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2127 / 3919
  • Number of attempts: 1
Delete unwanted lines - 358 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #143 / 215
  • Number of attempts: 1
Groups magic - 142 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • Position: #54 / 85
  • Number of attempts: 1
NATO phonetic alphabet - 479 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 23
  • Position: #127 / 182
  • Number of attempts: 1
The name of the game - 629 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #182 / 344
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1510 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Position: #203 / 424
  • Number of attempts: 1
switch variable - 4944 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #328 / 1708
  • Number of attempts: 1
The meaning - 522 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #239 / 337
  • Number of attempts: 1
Make it more readable - 1897 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 17
  • Position: #450 / 624
  • Number of attempts: 1
PHP Array Syntax -> MailChimp Merge Syntax - 482 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 29
  • Position: #66 / 143
  • Number of attempts: 1
Ruby 1.9 hashes - 1172 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: 14
  • Position: #224 / 386
  • Number of attempts: 1
Shebangs for all - 1777 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: 13
  • Position: #183 / 468
  • Number of attempts: 4
A Simple One - 934 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: #394 / 617
  • Number of attempts: 1
Reverse Simple Deletion - 772 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #296 / 432
  • Number of attempts: 1
Increment, increment, increment.... - 591 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #271 / 378
  • Number of attempts: 1
The Cake is a Lie - 1215 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #343 / 491
  • Number of attempts: 3
Change the content of a string - 1350 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #144 / 521
  • Number of attempts: 3
Simple text editing with Vim - 11657 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1282 / 3418
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 6033 entries

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

  • Best score: 32
  • Best player score: 42
  • Position: #896 / 1486
  • Number of attempts: 2
Jose Gutierrez
Twitter:

entered into 37 challenges

contributed 0 challenges