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

prepend * to every non-blank line - 6201 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 12
  • Position: #767 / 1514
  • Number of attempts: 2
Wrap the text of an email message to 79 characters - 676 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #147 / 384
  • Number of attempts: 2
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #912 / 1585
  • Number of attempts: 1
Interweave two blocks of text - 630 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 26
  • Position: #198 / 211
  • Number of attempts: 2
Python Hello World! Reformatting - 936 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: #152 / 363
  • Number of attempts: 2
Change your calendar - 352 entries

Happy New Year!

  • Best score: 18
  • Best player score: 26
  • Position: #33 / 83
  • Number of attempts: 1
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 37
  • Position: #98 / 171
  • Number of attempts: 2
Coordinates placeholder - 62 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 25
  • Position: #18 / 36
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 168 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 24
  • Best player score: 28
  • Position: #59 / 100
  • Number of attempts: 1
Extract text from xml - 106 entries

Extract text from xml file (ignoring commented out elements) and create a one line regex.

  • Best score: 28
  • Best player score: 41
  • Position: #27 / 43
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 400 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 11
  • Position: #113 / 187
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1569 entries

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

  • Best score: 8
  • Best player score: 16
  • Position: #417 / 437
  • Number of attempts: 1
Stairs Indenting - 446 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 20
  • Position: #176 / 193
  • Number of attempts: 1
Unwrap the text of an email message - 184 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 24
  • Position: #44 / 72
  • Number of attempts: 1
SFD-ROC: ROT13 Phonics - 96 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

  • Best score: 6
  • Best player score: 6
  • Position: #34 / 70
  • Number of attempts: 1
Let's play some Ivmgolf - 1084 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 13
  • Position: #410 / 440
  • Number of attempts: 1
Alphabet soup - 419 entries

Create a column of all alphabet characters organized in a funky way

  • Best score: 25
  • Best player score: 42
  • Position: #87 / 103
  • Number of attempts: 2
Switch function arguments - 2064 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #350 / 647
  • Number of attempts: 1
Append semicolon after expressions - 1002 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #294 / 401
  • Number of attempts: 2
Remove semicolons after expressions - 628 entries

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

  • Best score: 6
  • Best player score: 10
  • Position: #242 / 258
  • Number of attempts: 1
switch variable - 5028 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #729 / 1734
  • 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: 16
  • Position: #362 / 640
  • Number of attempts: 1
Sort entries based on date - 362 entries

Sort some entries in a Ledger-file based on date.

  • Best score: 11
  • Best player score: 80
  • Position: #114 / 114
  • Number of attempts: 1
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 30
  • Position: #148 / 194
  • Number of attempts: 1
expand a list comprehension (python) - 301 entries

Please show your way to convert a list comprehension in python to an ordinary for-loop expression!

  • Best score: 42
  • Best player score: 58
  • Position: #73 / 106
  • Number of attempts: 1
Numbering a List - 1855 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #371 / 638
  • Number of attempts: 1
Shebangs for all - 1904 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: 21
  • Position: #418 / 497
  • Number of attempts: 2
A Simple One - 996 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: #299 / 641
  • Number of attempts: 1
82 bottles of beer on the wall - 302 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

  • Best score: 106
  • Best player score: 123
  • Position: #47 / 140
  • Number of attempts: 1
Reverse and count - 455 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 28
  • Position: #107 / 172
  • Number of attempts: 1
Increment, increment, increment.... - 643 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #236 / 398
  • Number of attempts: 2
Sorting paragraphs - 505 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 33
  • Position: #95 / 156
  • Number of attempts: 1
Indentation - 497 entries

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

  • Best score: 21
  • Best player score: 26
  • Position: #66 / 168
  • Number of attempts: 2
Turn this csv list into queries - 204 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

  • Best score: 98
  • Best player score: 123
  • Position: #49 / 95
  • Number of attempts: 1
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 13
  • Position: #481 / 511
  • Number of attempts: 1
Fix the Haiku - 275 entries

Change this slightly scrambled haiku to its unscrambled form and fix the capitalisation and punctuation along the way.

  • Best score: 28
  • Best player score: 47
  • Position: #89 / 109
  • Number of attempts: 1
Context insensitive completion 0 - 502 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 12
  • Position: #218 / 231
  • Number of attempts: 2
Reformat some Python - 579 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 45
  • Position: #138 / 229
  • Number of attempts: 1
Reformat a C golf submission - 552 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 30
  • Position: #84 / 199
  • Number of attempts: 5
PEP8 Python Wrapping Comments and Code - 187 entries

According to PEP8, long flowy text and code should have different max line lengths. Code: 79 characters max Long flowy text: 72 characters max

  • Best score: 23
  • Best player score: 32
  • Position: #45 / 64
  • Number of attempts: 1
Remember FizzBuzz? - 653 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 76
  • Position: #144 / 177
  • Number of attempts: 1
Sort and add attributes - 1321 entries

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

  • Best score: 33
  • Best player score: 35
  • Position: #372 / 527
  • Number of attempts: 2
Simple text editing with Vim - 12230 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #983 / 3567
  • Number of attempts: 1
ajh
Twitter:

entered into 43 challenges

contributed 0 challenges