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 - 33616 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: 26
  • Position: #3428 / 7420
  • Number of attempts: 5
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2064 / 3864
  • Number of attempts: 4
multiple cursor alternative - 1519 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: 22
  • Position: #225 / 380
  • Number of attempts: 1
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 20
  • Position: #602 / 703
  • Number of attempts: 1
Extract argument from function - 2357 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #329 / 753
  • Number of attempts: 1
Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #993 / 1624
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #435 / 701
  • Number of attempts: 2
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 9
  • Position: #3290 / 4197
  • Number of attempts: 2
Make HTML List - 1050 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 55
  • Position: #247 / 273
  • Number of attempts: 3
Add to end of each line... kinda - 333 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Position: #61 / 174
  • Number of attempts: 2
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #651 / 2128
  • Number of attempts: 3
Restore order to the alphabet - 201 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 16
  • Position: #50 / 72
  • Number of attempts: 3
Array transposition - 2417 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 22
  • Position: #252 / 448
  • Number of attempts: 1
Mirror Symmetry - 822 entries

Add backslashes.

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

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 17
  • Position: #171 / 281
  • Number of attempts: 2
Line 'em up! - 421 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 26
  • Position: #83 / 114
  • Number of attempts: 1
Condensed Cases - 804 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: 14
  • Position: #139 / 247
  • Number of attempts: 1
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2100 / 4180
  • Number of attempts: 1
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #795 / 1137
  • Number of attempts: 1
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Position: #173 / 271
  • Number of attempts: 1
Don't know what this is - 2022 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: 15
  • Position: #400 / 585
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 14
  • Position: #2722 / 3683
  • Number of attempts: 1
Letter case trickery - 1630 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: 12
  • Position: #343 / 518
  • Number of attempts: 1
quotes inside quotes - 3159 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: 16
  • Position: #615 / 1078
  • Number of attempts: 1
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2238 / 3963
  • Number of attempts: 2
Presidential Sorting - 51 entries

Given a nice CSV formatted arrangement of the Presidents of the United States, we need to print out an alphabetical list in pretty columns. Prove that vim can conquer this basic Excel task!

  • Best score: 40
  • Best player score: 52
  • Position: #18 / 26
  • Number of attempts: 1
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #357 / 1748
  • Number of attempts: 1
Rotating Philosophers Problem - 410 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

  • Best score: 29
  • Best player score: 31
  • Position: #98 / 166
  • Number of attempts: 3
Simple text editing with Vim - 12811 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2237 / 3694
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 6982 entries

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

  • Best score: 28
  • Best player score: 39
  • Position: #730 / 1706
  • Number of attempts: 2
Stefan Knudsen
Twitter:

entered into 30 challenges

contributed 0 challenges