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 - 33385 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
  • Position: #1386 / 7364
  • Number of attempts: 17
One number per line - 18616 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Position: #883 / 3842
  • Number of attempts: 13
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #575 / 1879
  • Number of attempts: 5
Applying same text modification in several lines - 2845 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 14
  • Position: #329 / 840
  • Number of attempts: 5
Swap the operands under comparison - 270 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 19
  • Position: #6 / 98
  • Number of attempts: 7
Split line with dots - 2125 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 15
  • Position: #140 / 630
  • Number of attempts: 7
remove lines containing the word "reader" - 3537 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Position: #1005 / 1144
  • Number of attempts: 3
Com(m)a Trouble - 3675 entries

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

  • Best score: 12
  • Best player score: 19
  • Position: #594 / 827
  • Number of attempts: 3
Box it - 7828 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 26
  • Position: #1051 / 1865
  • Number of attempts: 9
From argument to object - 1474 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 17
  • Position: #100 / 450
  • Number of attempts: 5
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #228 / 700
  • Number of attempts: 8
Copy three lines - 2840 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #100 / 635
  • Number of attempts: 10
Array propagate - 319 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 23
  • Position: #14 / 115
  • Number of attempts: 6
Extract argument from function - 2314 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #204 / 744
  • Number of attempts: 7
Search and Replace 0 - 4792 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #520 / 1585
  • Number of attempts: 3
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #181 / 695
  • Number of attempts: 8
comment and uncomment code inline - 1069 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: 9
  • Position: #98 / 314
  • Number of attempts: 8
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2679 / 4164
  • Number of attempts: 7
Team names - 1805 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 21
  • Position: #508 / 581
  • Number of attempts: 1
Remember VimGolf Rules ! - 257 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #93 / 138
  • Number of attempts: 2
Basic renumbering - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #920 / 1258
  • Number of attempts: 12
Create a table - 325 entries

Convert the given input into a formatted table

  • Best score: 16
  • Best player score: 16
  • Position: #31 / 104
  • Number of attempts: 15
Vice versa - 7805 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #377 / 2101
  • Number of attempts: 8
comments galore - 998 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #250 / 418
  • Number of attempts: 7
Align commas - 1049 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
  • Position: #123 / 241
  • Number of attempts: 11
Python challenge - 147 entries

Change the types of the variables in the list from str to float, while keeping the truncation.

  • Best score: 31
  • Best player score: 35
  • Position: #18 / 44
  • Number of attempts: 4
One to Ten - 2165 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 38
  • Position: #660 / 662
  • Number of attempts: 1
Build a six - 272 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 31
  • Position: #80 / 92
  • Number of attempts: 1
Array transposition - 2378 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 17
  • Position: #122 / 443
  • Number of attempts: 20
Collect List - 4264 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #379 / 1186
  • Number of attempts: 7
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Position: #115 / 440
  • Number of attempts: 16
Fix the XML - 996 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #52 / 284
  • Number of attempts: 10
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2235 / 4161
  • Number of attempts: 10
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #238 / 1129
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10628 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1280 / 3667
  • Number of attempts: 3
attr_aligner - 3444 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #145 / 692
  • Number of attempts: 19
Letter case trickery - 1594 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: 9
  • Position: #21 / 511
  • Number of attempts: 15
quotes inside quotes - 3125 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: 14
  • Position: #295 / 1072
  • Number of attempts: 9
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2455 / 3946
  • Number of attempts: 3
Saving the hashes(#) - 1992 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: 20
  • Position: #56 / 473
  • Number of attempts: 14
Switch function arguments - 2082 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #154 / 652
  • Number of attempts: 10
Ugly spreadsheet copy/paste to CSV - 973 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 34
  • Position: #99 / 185
  • Number of attempts: 15
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #302 / 640
  • Number of attempts: 6
A Simple One - 1001 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: #476 / 643
  • Number of attempts: 1
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #335 / 454
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3340 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #117 / 737
  • Number of attempts: 13
Reformat/Refactor a Golfer Class - 6560 entries

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

  • Best score: 32
  • Best player score: 50
  • Position: #1332 / 1616
  • Number of attempts: 2
fucus
Twitter:

entered into 47 challenges

contributed 0 challenges