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

Python Hello World! Reformatting - 825 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
  • Number of attempts: 4
Exchanging Quotes - 756 entries

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

  • Best score: 30
  • Best player score: 37
  • Number of attempts: 4
Make HTML List - 855 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 36
  • Number of attempts: 6
FoodCritic023: Prefer conditional attributes - 161 entries

FoodCritic (www.foodcritic.io) is a lint tool for your Chef (learn.chef.io) cookbooks. FC023 indicates that you should prefer Chef guards over Ruby conditions. This challenge expects you to be able to fix this issue in a sample cookbook, given the FoodCritic output: ================================================================ FC023: Prefer conditional attributes: cookbooks/foo/recipes/default.rb:25 ================================================================ See http://www.foodcritic.io/#FC023 for more details about the changes being made.

  • Best score: 25
  • Best player score: 26
  • Number of attempts: 5
Mess in revision history - 944 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 23
  • Number of attempts: 4
Simple, Practical, and Common - 23292 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: 2
  • Best player score: 22
  • Number of attempts: 7
Scrambled numbers - 704 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 20
  • Number of attempts: 6
remove dupes from array - 1185 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: 20
  • Number of attempts: 3
VimGolfNight - 456 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
One number per line - 11722 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Number of attempts: 11
Collect List - 3354 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Let's play some Ivmgolf - 881 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 2
Saving the hashes(#) - 1696 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: 21
  • Number of attempts: 6
Don't know what this is - 1678 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: 12
  • Number of attempts: 4
Extract argument from function - 1933 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 9
Search and Replace 0 - 3968 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Switch function arguments - 1801 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Paragraph breaks - 392 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 3
Just the middle - 8843 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Vim's not included features - 157 entries

Filter not included (-) features in a hypothetical installation of vim.

  • Best score: 23
  • Best player score: 23
  • Number of attempts: 6
7th Birthday - 163 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 7
switch variable - 4212 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 11
  • Number of attempts: 2
Fix the XML - 845 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 23
  • Number of attempts: 3
Paragraph sort - 309 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 3
replace 2nd column blanks with values in same column if blank - 177 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 2
Split line with dots - 1754 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 22
  • Number of attempts: 4
Where should I put the Newline? - 788 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Free hyphen! - 112 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 2
Every other line - 1985 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 4
Combines all items - 234 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
V to the i - 3741 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 5
comments galore - 886 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 4
Sorting a glossary - 100 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 1
That hyphen - 2037 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 2
A Simple One - 832 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
Words in parens - 10718 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 3
Start coding format - 119 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 22
  • Number of attempts: 4
I forgot quotes - 11130 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 5
C Reformatting - 593 entries

You may use Visual mode... or not. #uppercase

  • Best score: 30
  • Best player score: 32
  • Number of attempts: 7
Reverse Simple Deletion - 700 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 5
Vice versa - 5698 entries

Little role switching.

  • Best score: 2
  • Best player score: 12
  • Number of attempts: 7
Generate a list of numbers - 238 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 5
Add to end of each line... kinda - 263 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Inner hyphens - 111 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Order and join - 723 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 2
-a-b-c- - 2491 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Copy three lines - 1934 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 3
Ruby 1.9 hashes - 1046 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
  • Number of attempts: 2
Swap values - 3357 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 3
Basic renumbering - 4446 entries

Renumbering Basic.

  • Best score: 2
  • Best player score: 11
  • Number of attempts: 3
Gray area - 619 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 6
Align commas - 782 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 2
Shuffle puzzle - 289 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Remove noise from HTTP log - 599 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: 16
  • Number of attempts: 2
Array of characters - 114 entries

We all copy paste things off the internet, but the syntax doesn't look right. Fix it as fast as possible.

  • Best score: 33
  • Best player score: 41
  • Number of attempts: 3
120 Degrees - 350 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 4
Make Fancy Header - 898 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 9319 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
Space out the alphabet - 1325 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 1
Do you demand a shrubbery? - 1001 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 7
attr_aligner - 2874 entries

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

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 12
Bill Ruddock
Twitter:

Software engineer, Scout, circus skills freak

entered into 61 challenges

contributed 0 challenges