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

Stairs Indenting - 384 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 20
  • Number of attempts: 1
Fix the Haiku - 247 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
  • Number of attempts: 1
expand a list comprehension (python) - 252 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
  • Number of attempts: 1
Reformat a C golf submission - 488 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
  • Number of attempts: 5
Extract text from xml - 101 entries

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

  • Best score: 28
  • Best player score: 41
  • Number of attempts: 1
Alphabet soup - 157 entries

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

  • Best score: 25
  • Best player score: 42
  • Number of attempts: 2
Change your calendar - 270 entries

Happy New Year!

  • Best score: 18
  • Best player score: 26
  • Number of attempts: 1
PEP8 Python Wrapping Comments and Code - 155 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
  • Number of attempts: 1
Interweave two blocks of text - 522 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
  • Number of attempts: 2
The Cake is a Lie - 1166 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 13
  • Number of attempts: 1
Switch function arguments - 1888 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
Indentation - 418 entries

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

  • Best score: 21
  • Best player score: 26
  • Number of attempts: 2
Reverse and count - 382 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
  • Number of attempts: 1
Simple text editing with Vim - 11054 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 1
SFD-ROC: ROT13 Phonics - 71 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
  • Number of attempts: 1
Search and Replace 0 - 4444 entries

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

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
Remove semicolons after expressions - 499 entries

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

  • Best score: 6
  • Best player score: 10
  • Number of attempts: 1
Increment, increment, increment.... - 515 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 2
Make it more readable - 1812 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
Shebangs for all - 1669 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
  • Number of attempts: 2
Minimalist Limerick - 494 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 37
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1381 entries

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

  • Best score: 8
  • Best player score: 16
  • Number of attempts: 1
Reformat some Python - 519 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 45
  • Number of attempts: 1
Sorting paragraphs - 455 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 33
  • Number of attempts: 1
Turn this csv list into queries - 190 entries

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

  • Best score: 98
  • Best player score: 123
  • Number of attempts: 1
Context insensitive completion 0 - 454 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
  • Number of attempts: 2
imports alignment (python) - 584 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 30
  • Number of attempts: 1
Sort entries based on date - 304 entries

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

  • Best score: 11
  • Best player score: 80
  • Number of attempts: 1
Coordinates placeholder - 52 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 25
  • Number of attempts: 1
Numbering a List - 1764 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Number of attempts: 1
Sort and add attributes - 1113 entries

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

  • Best score: 33
  • Best player score: 35
  • Number of attempts: 2
switch variable - 4663 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
82 bottles of beer on the wall - 280 entries

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

  • Best score: 107
  • Best player score: 123
  • Number of attempts: 1
Python Hello World! Reformatting - 859 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
  • Number of attempts: 2
Let's play some Ivmgolf - 975 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 13
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 517 entries

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

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 2
The Quick Brown Fox Jumps Over The Lazy Vim - 339 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: 10
  • Best player score: 11
  • Number of attempts: 3
Append semicolon after expressions - 898 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 2
A Simple One - 854 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
SFD-ROC: The Quick Brown Fox - 143 entries

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

  • Best score: 25
  • Best player score: 28
  • Number of attempts: 1
Remember FizzBuzz? - 548 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 76
  • Number of attempts: 1
prepend * to every non-blank line - 3338 entries

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

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 2
Unwrap the text of an email message - 154 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
  • Number of attempts: 1
ajh
Twitter:

entered into 43 challenges

contributed 0 challenges