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 - 33801 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: #5746 / 7459
  • Number of attempts: 1
Swap values - 4651 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 16
  • Position: #1038 / 1278
  • Number of attempts: 1
V to the i - 4826 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #210 / 1900
  • Number of attempts: 3
Every other line - 2922 entries

AaAaAaA

  • Best score: 12
  • Best player score: 23
  • Position: #658 / 706
  • Number of attempts: 3
Start coding format - 155 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 24
  • Position: #49 / 72
  • Number of attempts: 1
Just the middle - 11523 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1836 / 4222
  • Number of attempts: 3
Interweave two blocks of text - 661 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 35
  • Position: #213 / 215
  • Number of attempts: 1
Python Hello World! Reformatting - 1007 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 42
  • Position: #126 / 384
  • Number of attempts: 1
Basic renumbering - 5693 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 23
  • Position: #1003 / 1271
  • Number of attempts: 1
Vice versa - 7971 entries

Little role switching.

  • Best score: 12
  • Best player score: 16
  • Position: #1136 / 2145
  • Number of attempts: 1
Assign numbers to fields - 116 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 20
  • Position: #30 / 62
  • Number of attempts: 1
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 14
  • Position: #218 / 269
  • Number of attempts: 1
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 18
  • Position: #222 / 281
  • Number of attempts: 1
Logging with key - 328 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 46
  • Position: #84 / 88
  • Number of attempts: 1
Space out the alphabet - 1659 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 23
  • Position: #350 / 446
  • Number of attempts: 1
Mute the second method of this script - 455 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 10
  • Position: #195 / 239
  • Number of attempts: 1
Winning streak - 135 entries

Make the number on each line equal the consecutive L's or W's.

  • Best score: 21
  • Best player score: 39
  • Position: #44 / 51
  • Number of attempts: 1
I forgot quotes - 16075 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #2883 / 4198
  • Number of attempts: 4
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #930 / 1138
  • Number of attempts: 3
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 17
  • Position: #302 / 354
  • Number of attempts: 1
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 16
  • Position: #257 / 271
  • Number of attempts: 1
Don't know what this is - 2024 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: 16
  • Position: #491 / 586
  • Number of attempts: 2
Two become one - 716 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 35
  • Position: #159 / 209
  • Number of attempts: 1
Where should I put the Newline? - 883 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #359 / 438
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10703 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Position: #3061 / 3696
  • Number of attempts: 2
attr_aligner - 3525 entries

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

  • Best score: 19
  • Best player score: 31
  • Position: #431 / 706
  • Number of attempts: 1
quotes inside quotes - 3182 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: 25
  • Position: #1050 / 1085
  • Number of attempts: 2
Words in parens - 12980 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1477 / 3972
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1619 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 13
  • Position: #309 / 449
  • Number of attempts: 1
Vertical Limit - 2576 entries

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

  • Best score: 21
  • Best player score: 36
  • Position: #724 / 762
  • Number of attempts: 1
switch variable - 5089 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1388 / 1751
  • Number of attempts: 3
The meaning - 577 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #251 / 364
  • Number of attempts: 2
Replacing some words - 428 entries

How fast could it be?

  • Best score: 17
  • Best player score: 26
  • Position: #106 / 151
  • Number of attempts: 1
The holy-grail may help - 389 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #139 / 215
  • Number of attempts: 1
Simple text editing with Vim - 13183 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #2141 / 3789
  • Number of attempts: 1
Joel Gallant
Twitter:

Computer Vision Technologist, Figuring out the world one day at a time.

entered into 35 challenges

contributed 0 challenges