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 - 33791 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: #1499 / 7455
  • Number of attempts: 5
Swap values - 4647 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 16
  • Position: #1084 / 1276
  • Number of attempts: 1
One number per line - 18801 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 22
  • Position: #2728 / 3882
  • Number of attempts: 2
Swap values inside brackets - 2521 entries

Easy challenge.

  • Best score: 13
  • Best player score: 21
  • Position: #426 / 585
  • Number of attempts: 1
V to the i - 4824 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #597 / 1899
  • Number of attempts: 5
Applying same text modification in several lines - 2907 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #306 / 860
  • Number of attempts: 7
Swap the operands under comparison - 311 entries

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

  • Best score: 19
  • Best player score: 29
  • Position: #90 / 104
  • Number of attempts: 1
Com(m)a Trouble - 3907 entries

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

  • Best score: 12
  • Best player score: 17
  • Position: #540 / 886
  • Number of attempts: 1
multiple cursor alternative - 1547 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 23
  • Position: #278 / 385
  • Number of attempts: 1
Every other line - 2922 entries

AaAaAaA

  • Best score: 12
  • Best player score: 22
  • Position: #649 / 706
  • Number of attempts: 2
Copy three lines - 2875 entries

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

  • Best score: 13
  • Best player score: 19
  • Position: #379 / 641
  • Number of attempts: 2
Number Sort - 319 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: 10
  • Position: #154 / 170
  • Number of attempts: 1
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #612 / 701
  • Number of attempts: 2
comment and uncomment code inline - 1151 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: #105 / 328
  • Number of attempts: 7
Just the middle - 11509 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2735 / 4218
  • Number of attempts: 2
Team names - 1848 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 20
  • Position: #492 / 592
  • Number of attempts: 1
For all cases. - 168 entries

In this case... change it! :) Watch the line.

  • Best score: 8
  • Best player score: 8
  • Position: #60 / 108
  • Number of attempts: 2
Basic renumbering - 5685 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 23
  • Position: #1063 / 1270
  • Number of attempts: 1
Interactive git rebase changing commands - 176 entries

How to change the action of some commits in git rebase dialog.

  • Best score: 14
  • Best player score: 28
  • Position: #80 / 80
  • Number of attempts: 1
Adam's challenge - 1008 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
  • Position: #71 / 275
  • Number of attempts: 8
replace 2nd column blanks with values in same column if blank - 242 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

  • Best score: 15
  • Best player score: 19
  • Position: #69 / 83
  • Number of attempts: 1
Fun With The Diagonal - 107 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #59 / 81
  • Number of attempts: 1
Vice versa - 7968 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #409 / 2144
  • Number of attempts: 5
Convert pasted text into Markdown - 32 entries

I often need to copy/paste text into Markdown files. The challenge here is to wrap the lines in a way that prefers breaks after periods, commas, or other logical demarcations. There should be no spaces at the beginning of a line.

  • Best score: 46
  • Best player score: 90
  • Position: #11 / 14
  • Number of attempts: 1
Sort files from hosts - 195 entries

Resume files by host. I hope you enjoy with this challenge

  • Best score: 15
  • Best player score: 18
  • Position: #68 / 77
  • Number of attempts: 2
Order and join - 985 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 14
  • Position: #216 / 260
  • Number of attempts: 2
comments galore - 1073 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #263 / 429
  • Number of attempts: 2
Angular naming conventions - 326 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: 21
  • Position: #77 / 119
  • Number of attempts: 1
Replace and keep the case - 437 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 37
  • Position: #106 / 118
  • Number of attempts: 1
Scrambled numbers - 807 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 35
  • Position: #165 / 184
  • Number of attempts: 1
Align commas - 1097 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: 17
  • Position: #174 / 247
  • Number of attempts: 1
A grid of punctuation - 140 entries

Create a checkerboard of = and - in an 80×24 grid!

  • Best score: 16
  • Best player score: 20
  • Position: #52 / 62
  • Number of attempts: 1
Generate a list of numbers - 299 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 16
  • Position: #123 / 141
  • Number of attempts: 1
One to Ten - 2240 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: 14
  • Position: #428 / 681
  • Number of attempts: 1
Array transposition - 2430 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 33
  • Position: #389 / 451
  • Number of attempts: 1
Collect List - 4312 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 17
  • Position: #990 / 1193
  • Number of attempts: 2
Fix the XML - 1039 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #200 / 290
  • Number of attempts: 2
Conway sequence - 26 entries

Generate the the first fifteen numbers. See here for more information: http://en.wikipedia.org/wiki/Look-and-say_sequence

  • Best score: 43
  • Best player score: 43
  • Position: #14 / 20
  • Number of attempts: 1
I forgot quotes - 16061 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2271 / 4195
  • Number of attempts: 2
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #851 / 1138
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10699 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1316 / 3695
  • Number of attempts: 2
Letter case trickery - 1644 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: #23 / 520
  • Number of attempts: 6
Words in parens - 12975 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 18
  • Position: #2982 / 3971
  • Number of attempts: 1
Switch function arguments - 2162 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #157 / 669
  • Number of attempts: 6
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 17
  • Position: #1626 / 1750
  • Number of attempts: 1
Simple text editing with Vim - 13145 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1721 / 3778
  • Number of attempts: 2
Sxcy
Twitter:

entered into 46 challenges

contributed 0 challenges