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

Prime Numbers - 342 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 43
  • Position: #37 / 101
  • Number of attempts: 4
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #980 / 3044
  • Number of attempts: 2
Wrap the text of an email message to 79 characters - 679 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #29 / 386
  • Number of attempts: 1
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #95 / 1585
  • Number of attempts: 7
Interweave two blocks of text - 631 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: 17
  • Position: #73 / 211
  • Number of attempts: 3
Python Hello World! Reformatting - 938 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: 42
  • Position: #94 / 364
  • Number of attempts: 5
Recursively Palindrome - 239 entries

Note that there are 2^6-1 characters.

  • Best score: 21
  • Best player score: 24
  • Position: #33 / 73
  • Number of attempts: 2
replacing each line of a block selection - 2946 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #6 / 767
  • Number of attempts: 2
switch variable - 5031 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #65 / 1735
  • Number of attempts: 7
The meaning - 558 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #30 / 356
  • Number of attempts: 1
Replacing some words - 419 entries

How fast could it be?

  • Best score: 17
  • Best player score: 17
  • Position: #3 / 148
  • Number of attempts: 4
Sort the cardinal numbers - 293 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 12
  • Position: #5 / 146
  • Number of attempts: 2
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #125 / 640
  • Number of attempts: 4
Line Zipper - 450 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #103 / 210
  • Number of attempts: 1
Alphabetize the directory - 283 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 32
  • Position: #26 / 99
  • Number of attempts: 4
Complete the hex array data - 195 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 23
  • Best player score: 26
  • Position: #24 / 72
  • Number of attempts: 3
Case preserving word replacement - 453 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 19
  • Position: #5 / 179
  • Number of attempts: 2
Complete the hex array data (Part II) - 156 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 20
  • Best player score: 22
  • Position: #12 / 67
  • Number of attempts: 1
Happy New Year! - 143 entries

This is a simple new year's challenge.

  • Best score: 22
  • Best player score: 24
  • Position: #21 / 57
  • Number of attempts: 3
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #10 / 194
  • Number of attempts: 3
Generate Fibonacci Numbers - 262 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 23
  • Position: #58 / 97
  • Number of attempts: 2
It'ss tooo coold too typpe todaay - 215 entries

My hands are numb with cold. It's hard to type correctly.

  • Best score: 16
  • Best player score: 16
  • Position: #4 / 96
  • Number of attempts: 4
Rotating Philosophers Problem - 390 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

  • Best score: 29
  • Best player score: 29
  • Position: #3 / 163
  • Number of attempts: 3
HTML to Haml - 842 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 47
  • Position: #153 / 202
  • 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: 42
  • Position: #6 / 106
  • Number of attempts: 5
Generate English Alphabets - 472 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Position: #31 / 202
  • Number of attempts: 2
Overall Vimgolf Rank - 170 entries

Suppose you are trying to figure out what your overall rank is at Vimgolf(the sum of all the ranks you got), and as a Vim ninja you decided to use Vim to do the job. Your solution should work for every Vimgolf profile page(The actual input file for this challenge is my Vimgolf profile page). So, direct answer insertion is considered cheating.

  • Best score: 23
  • Best player score: 24
  • Position: #10 / 57
  • Number of attempts: 3
Insert a Markdown link - 431 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 23
  • Position: #24 / 143
  • Number of attempts: 5
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #152 / 639
  • Number of attempts: 2
Solve the Sokoban - 164 entries

A wink for all Vimgolfers that play Nethack too.

  • Best score: 25
  • Best player score: 30
  • Position: #23 / 72
  • Number of attempts: 5
The holy-grail may help - 345 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #64 / 205
  • Number of attempts: 2
Ruby 1.9 hashes - 1221 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: 12
  • Position: #13 / 401
  • Number of attempts: 7
Assignment Alignment - 832 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Position: #60 / 215
  • Number of attempts: 3
Shebangs for all - 1912 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: 12
  • Position: #97 / 500
  • Number of attempts: 9
A Simple One - 999 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: #170 / 642
  • Number of attempts: 2
Round Round - 287 entries

Round Round

  • Best score: 19
  • Best player score: 23
  • Position: #29 / 84
  • Number of attempts: 8
Table Reshuffle - 371 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 23
  • Position: #8 / 134
  • Number of attempts: 7
Letters are numbers - 150 entries

Letters and numbers are interchangeable. A lot of programming languages give you simple ways to convert individual letters to hex, binary and decimal but does Vim?

  • Best score: 20
  • Best player score: 26
  • Position: #21 / 73
  • Number of attempts: 2
Ruby 1.9 compat - 610 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: #15 / 230
  • Number of attempts: 7
Increment, increment, increment.... - 662 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #174 / 401
  • 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: 30
  • Position: #111 / 168
  • Number of attempts: 1
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: 124
  • Position: #52 / 95
  • Number of attempts: 1
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #83 / 511
  • Number of attempts: 3
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: 33
  • Position: #21 / 109
  • Number of attempts: 3
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: 7
  • Position: #37 / 231
  • Number of attempts: 3
Context Insensitive completion 1 - 459 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #58 / 232
  • Number of attempts: 3
Almost encrypted - 198 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Position: #54 / 144
  • Number of attempts: 1
Make Fancy Header - 1014 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 16
  • Position: #31 / 338
  • Number of attempts: 4
Reformat some Python - 579 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 34
  • Position: #8 / 229
  • Number of attempts: 6
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: 31
  • Position: #94 / 199
  • Number of attempts: 4
Reverse characters in a line - 709 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 18
  • Position: #174 / 249
  • Number of attempts: 3
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: 27
  • Position: #31 / 64
  • Number of attempts: 2
Change the content of a string - 1474 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #37 / 557
  • Number of attempts: 6
Deleting folded text - 341 entries

The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.

  • Best score: 17
  • Best player score: 20
  • Position: #39 / 113
  • Number of attempts: 3
Sort and add attributes - 1327 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #48 / 529
  • Number of attempts: 3
Add fold markers to a .c file - 556 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 30
  • Best player score: 30
  • Position: #3 / 172
  • Number of attempts: 6
Reconstruct the Sentence - 1363 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: 20
  • Position: #10 / 383
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3330 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 22
  • Position: #239 / 735
  • Number of attempts: 8
Flodder-challenge - 1117 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 28
  • Position: #40 / 311
  • Number of attempts: 6
Simple text editing with Vim - 12276 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #777 / 3578
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 6548 entries

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

  • Best score: 32
  • Best player score: 34
  • Position: #276 / 1612
  • Number of attempts: 8
Oleg Roshupkin
Twitter:

vim me baby one more time

entered into 61 challenges

contributed 0 challenges