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

Simple, Practical, and Common - 33483 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: 22
  • Best player score: 32
  • Position: #5827 / 7384
  • Number of attempts: 1
Swap values - 4554 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Position: #902 / 1259
  • Number of attempts: 3
One number per line - 18673 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #1782 / 3852
  • Number of attempts: 6
V to the i - 4771 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1280 / 1887
  • Number of attempts: 4
Add semicolons - 10831 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #38 / 3055
  • Number of attempts: 2
Every other line - 2902 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #494 / 702
  • Number of attempts: 2
Search and Replace 0 - 4851 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #586 / 1604
  • Number of attempts: 5
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2606 / 4174
  • Number of attempts: 1
Team names - 1812 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 18
  • Position: #353 / 585
  • Number of attempts: 1
Learn some german verbs - 532 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 24
  • Position: #68 / 132
  • Number of attempts: 5
Stairstep digits - 383 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #103 / 143
  • Number of attempts: 2
Basic renumbering - 5605 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 20
  • Position: #809 / 1260
  • Number of attempts: 1
create arrows in a list - 106 entries

Add arrow at same distance

  • Best score: 10
  • Best player score: 10
  • Position: #49 / 71
  • Number of attempts: 1
Fiddle percentages into real numbers - 841 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 17
  • Position: #216 / 288
  • Number of attempts: 2
Wrap text in quotes - 351 entries

All the blocks of text should be wrapped in quotation marks.

  • Best score: 16
  • Best player score: 19
  • Position: #95 / 121
  • Number of attempts: 1
Fun With The Diagonal - 104 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #53 / 80
  • Number of attempts: 1
Paragraph breaks - 509 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 14
  • Position: #143 / 166
  • Number of attempts: 1
comments galore - 1017 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 11
  • Position: #361 / 421
  • Number of attempts: 2
Scrambled numbers - 780 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 30
  • Position: #142 / 183
  • Number of attempts: 1
Mirror Symmetry - 812 entries

Add backslashes.

  • Best score: 7
  • Best player score: 13
  • Position: #215 / 268
  • Number of attempts: 1
From A to B - 575 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #90 / 157
  • Number of attempts: 1
Space out the alphabet - 1630 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 20
  • Position: #267 / 442
  • Number of attempts: 1
Sorting database text output - 220 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

  • Best score: 24
  • Best player score: 30
  • Position: #75 / 82
  • Number of attempts: 6
Happy TvvO - 417 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #127 / 204
  • Number of attempts: 1
I forgot quotes - 15946 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #735 / 4166
  • Number of attempts: 8
-a-b-c- - 3183 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #857 / 1132
  • Number of attempts: 4
Count both ways - 1006 entries

Right AND down.

  • Best score: 13
  • Best player score: 20
  • Position: #339 / 352
  • Number of attempts: 2
Gray area - 745 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Position: #233 / 270
  • Number of attempts: 3
Don't know what this is - 1996 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: 15
  • Position: #412 / 581
  • Number of attempts: 1
Where should I put the Newline? - 874 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #388 / 436
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1257 / 3677
  • Number of attempts: 5
Coordinates placeholder - 64 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 24
  • Position: #16 / 37
  • Number of attempts: 2
NATO phonetic alphabet - 506 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 25
  • Position: #163 / 194
  • Number of attempts: 1
Simple Maths 2 - 35 entries

Time to practice expression register! #maths #linear

  • Best score: 17
  • Best player score: 21
  • Position: #7 / 15
  • Number of attempts: 4
The name of the game - 654 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #228 / 359
  • Number of attempts: 1
Let's play some Ivmgolf - 1096 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #305 / 442
  • Number of attempts: 2
Vertical Limit - 2487 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 24
  • Position: #296 / 748
  • Number of attempts: 1
Exchanging Quotes - 824 entries

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

  • Best score: 30
  • Best player score: 35
  • Position: #101 / 227
  • Number of attempts: 1
Switch function arguments - 2085 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #414 / 653
  • Number of attempts: 2
Remove semicolons after expressions - 639 entries

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

  • Best score: 6
  • Best player score: 10
  • Position: #248 / 261
  • Number of attempts: 3
The meaning - 566 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #276 / 360
  • Number of attempts: 1
Make it more readable - 1955 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #403 / 643
  • Number of attempts: 4
remove dupes from array - 1345 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: 22
  • Position: #181 / 333
  • Number of attempts: 2
Rotating Philosophers Problem - 392 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: 32
  • Position: #119 / 165
  • Number of attempts: 1
HTML to Haml - 843 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 32
  • Position: #78 / 203
  • Number of attempts: 3
Numbering a List - 1869 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #410 / 646
  • Number of attempts: 3
Ruby 1.9 hashes - 1225 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: 13
  • Position: #171 / 402
  • Number of attempts: 1
Shebangs for all - 1917 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: 15
  • Position: #276 / 502
  • Number of attempts: 3
A Simple One - 1009 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: #467 / 648
  • Number of attempts: 1
Reverse Simple Deletion - 834 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #332 / 455
  • Number of attempts: 1
Increment, increment, increment.... - 668 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #339 / 404
  • Number of attempts: 2
Sorting paragraphs - 510 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 27
  • Position: #69 / 159
  • Number of attempts: 3
The Cake is a Lie - 1301 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #242 / 517
  • Number of attempts: 2
Context insensitive completion 0 - 545 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: 9
  • Position: #199 / 239
  • Number of attempts: 2
Make Fancy Header - 1024 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 18
  • Position: #239 / 340
  • Number of attempts: 4
Reverse characters in a line - 732 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: 13
  • Position: #74 / 257
  • Number of attempts: 3
Reformat most common surnames - 671 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 26
  • Position: #77 / 202
  • Number of attempts: 5
Change the content of a string - 1502 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #359 / 567
  • Number of attempts: 1
Sort and add attributes - 1369 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #207 / 542
  • Number of attempts: 5
Paul Draghicescu
Twitter:

entered into 59 challenges

contributed 0 challenges