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

I forgot quotes - 13746 entries

Oops.

  • Best score: 10
  • Best player score: 57
  • Number of attempts: 1
Order and join - 796 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 11
-a-b-c- - 2813 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 5
quotes inside quotes - 2909 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 5
vim = 22 / 7 - 408 entries

pi square vim

  • Best score: 20
  • Best player score: 40
  • Number of attempts: 1
Swap values inside brackets - 2044 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 10
That hyphen - 2319 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 5
switch variable - 4541 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 3
Simple text editing with Vim - 10898 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Adam's challenge - 866 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: 18
  • Number of attempts: 10
A HAPPY NEW YEAR 2014 ! - 9973 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 2
The Cake is a Lie - 1148 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 1
Collect List - 3793 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 5
Insert a Markdown link - 389 entries

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

  • Best score: 22
  • Best player score: 25
  • Number of attempts: 2
Just the middle - 10102 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 7
Remember VimGolf Rules ! - 208 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 1
Complete the hex array data (Part II) - 129 entries

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

  • Best score: 20
  • Best player score: 26
  • Number of attempts: 2
V to the i - 4253 entries

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

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

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 3
Where should I put the Newline? - 824 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
The holy-grail may help - 302 entries

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

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 9
Ninjas Leaderboard - 84 entries

The two lines in "Start file" has an obfuscated email address. Second line give an index (from 1 to 30) to the chars list of the first line, for example, the first char of email (n) is in position 25, second char (i) is in position 19 and s.o.

  • Best score: 25
  • Best player score: 34
  • Number of attempts: 4
Number Sort - 261 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
  • Number of attempts: 1
Team names - 1598 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 9
comment and uncomment code inline - 918 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: 12
  • Number of attempts: 4
Extract argument from function - 2106 entries

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

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 5
Context Insensitive completion 1 - 397 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 3
Top X - 181 entries

The End File is the Top 10 Vimgolf Leaderboard at June 29, 2013. This is a second version, with a great contribution of @udioica. X is ten in Roman,a numeric system in ancient Rome

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 12
Round Round - 240 entries

Round Round

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 22
Vice versa - 6677 entries

Little role switching.

  • Best score: 12
  • Best player score: 20
  • Number of attempts: 2
Every other line - 2393 entries

AaAaAaA

  • Best score: 12
  • Best player score: 20
  • Number of attempts: 2
NATO phonetic alphabet - 408 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 4
Simple, Practical, and Common - 28870 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: 22
  • Number of attempts: 14
Fiddle percentages into real numbers - 756 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: 27
  • Number of attempts: 1
Switch function arguments - 1872 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
Vertical Limit - 2211 entries

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

  • Best score: 21
  • Best player score: 23
  • Number of attempts: 6
Words in parens - 11806 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 25
  • Number of attempts: 2
Reformat a C golf submission - 481 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: 23
  • Best player score: 32
  • Number of attempts: 3
Copy three lines - 2369 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
convert yml into java pojo field - 758 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

  • Best score: 29
  • Best player score: 32
  • Number of attempts: 4
Sort and add attributes - 1110 entries

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

  • Best score: 33
  • Best player score: 33
  • Number of attempts: 2
Nesting SASS - 235 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 15
  • Number of attempts: 5
Basic renumbering - 5019 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 11
Align commas - 928 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: 33
  • Number of attempts: 1
Change your calendar - 270 entries

Happy New Year!

  • Best score: 18
  • Best player score: 105
  • Number of attempts: 1
Vim tetris - 345 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 39
  • Number of attempts: 1
Carriage return - 41 entries

I have some raw data from terminal output which uses carriege return for formatting. Carriage return sets the pointer to the first character on the line, and subsequent characters will overwrite what was there before. The challange is to simulate the terminal behaviour in vim. I'm kind of unsure if I should have skipped lines 9 and 15, since there might be some interesting solutions which are not that generic. Happy Golfing!

  • Best score: 22
  • Best player score: 45
  • Number of attempts: 1
Saving the hashes(#) - 1854 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: 53
  • Number of attempts: 2
Hugo
Twitter:

entered into 48 challenges

contributed 0 challenges