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 - 33982 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: #5954 / 7508
  • Number of attempts: 4
Swap values - 4703 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #262 / 1291
  • Number of attempts: 11
Swap values inside brackets - 2549 entries

Easy challenge.

  • Best score: 13
  • Best player score: 24
  • Position: #506 / 593
  • Number of attempts: 5
remove lines containing the word "reader" - 3646 entries

easy stuff

  • Best score: 9
  • Best player score: 15
  • Position: #1094 / 1183
  • Number of attempts: 1
Com(m)a Trouble - 3990 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 48
  • Position: #871 / 909
  • Number of attempts: 1
Box it - 7999 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 22
  • Position: #467 / 1899
  • Number of attempts: 7
Cool or not? - 857 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 16
  • Position: #90 / 236
  • Number of attempts: 6
Extract argument from function - 2401 entries

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

  • Best score: 13
  • Best player score: 21
  • Position: #727 / 768
  • Number of attempts: 1
Search and Replace 0 - 5124 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #564 / 1670
  • Number of attempts: 5
Number Sort - 322 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Position: #103 / 172
  • Number of attempts: 2
That hyphen - 2624 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 20
  • Position: #686 / 708
  • Number of attempts: 1
comment and uncomment code inline - 1161 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 10
  • Position: #206 / 330
  • Number of attempts: 7
Just the middle - 11611 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2823 / 4252
  • Number of attempts: 4
Make HTML List - 1071 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 46
  • Position: #142 / 275
  • Number of attempts: 6
Todo list specification - 409 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 42
  • Position: #177 / 185
  • Number of attempts: 1
Basic renumbering - 5731 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #500 / 1277
  • Number of attempts: 8
Simple addition - 341 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 16
  • Position: #118 / 126
  • Number of attempts: 1
Adam's challenge - 1020 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 19
  • Position: #124 / 279
  • Number of attempts: 10
Create a table - 342 entries

Convert the given input into a formatted table

  • Best score: 16
  • Best player score: 42
  • Position: #106 / 107
  • Number of attempts: 1
Vice versa - 8011 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #449 / 2153
  • Number of attempts: 11
Paragraph sort - 456 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #71 / 126
  • Number of attempts: 7
Angular naming conventions - 345 entries

In angular, a directive name follows the camelCase convention. When the directive is used in an HTML template, the words are instead separated by a dash. Go from to the other the fastest!

  • Best score: 18
  • Best player score: 32
  • Position: #118 / 122
  • Number of attempts: 1
Align commas - 1105 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: 11
  • Position: #79 / 248
  • Number of attempts: 13
Hello ${world} - 344 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

  • Best score: 24
  • Best player score: 32
  • Position: #72 / 102
  • Number of attempts: 6
Put the months in order - 1001 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

  • Best score: 20
  • Best player score: 55
  • Position: #145 / 168
  • Number of attempts: 2
Collect List - 4333 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 13
  • Position: #608 / 1197
  • Number of attempts: 7
Space out the alphabet - 1691 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 23
  • Position: #372 / 455
  • Number of attempts: 2
Condensed Cases - 821 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 12
  • Position: #56 / 252
  • Number of attempts: 11
I forgot quotes - 16185 entries

Oops.

  • Best score: 10
  • Best player score: 19
  • Position: #3547 / 4221
  • Number of attempts: 2
120 Degrees - 517 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 17
  • Position: #53 / 147
  • Number of attempts: 12
Gray area - 757 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #114 / 274
  • Number of attempts: 6
Don't know what this is - 2048 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
  • Position: #227 / 592
  • Number of attempts: 10
Mess in revision history - 1228 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 29
  • Position: #198 / 256
  • Number of attempts: 6
A HAPPY NEW YEAR 2014 ! - 10749 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2389 / 3712
  • Number of attempts: 1
Letter case trickery - 1664 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 18
  • Position: #489 / 523
  • Number of attempts: 2
Words in parens - 13033 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1731 / 3987
  • Number of attempts: 7
Minimalist Limerick - 532 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 31
  • Position: #31 / 176
  • Number of attempts: 10
Resort and deup a CSV list - 185 entries

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

  • Best score: 44
  • Best player score: 70
  • Position: #40 / 46
  • Number of attempts: 4
Let's play some Ivmgolf - 1153 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #120 / 457
  • Number of attempts: 9
replacing each line of a block selection - 3050 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #110 / 787
  • Number of attempts: 10
Switch function arguments - 2204 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #163 / 681
  • Number of attempts: 7
Append semicolon after expressions - 1071 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #248 / 425
  • Number of attempts: 3
Make it more readable - 2036 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #190 / 657
  • Number of attempts: 5
remove dupes from array - 1375 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: 19
  • Position: #122 / 340
  • Number of attempts: 5
Ruby 1.9 hashes - 1293 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: #92 / 417
  • Number of attempts: 5
A Simple One - 1079 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: #502 / 677
  • Number of attempts: 1
The Cake is a Lie - 1399 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 9
  • Position: #249 / 541
  • Number of attempts: 4
Make Fancy Header - 1089 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 27
  • Position: #328 / 354
  • Number of attempts: 1
Change the content of a string - 1779 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #332 / 651
  • Number of attempts: 4
Sort and add attributes - 1576 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #218 / 611
  • Number of attempts: 4
Reconstruct the Sentence - 1733 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 39
  • Position: #427 / 455
  • Number of attempts: 3
Vimfiz
Twitter:

entered into 51 challenges

contributed 0 challenges