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 - 33970 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: 25
  • Position: #3162 / 7503
  • Number of attempts: 1
V to the i - 4860 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #229 / 1910
  • Number of attempts: 2
Search and Replace 0 - 5115 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #393 / 1667
  • Number of attempts: 3
That hyphen - 2624 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #610 / 708
  • Number of attempts: 1
Just the middle - 11590 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2004 / 4246
  • Number of attempts: 1
Basic renumbering - 5731 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 18
  • Position: #663 / 1277
  • Number of attempts: 2
Collect List - 4332 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #101 / 1196
  • Number of attempts: 2
VimGolfNight - 581 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #220 / 353
  • Number of attempts: 1
camel riding - 796 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 16
  • Position: #111 / 282
  • Number of attempts: 3
readability - 331 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 19
  • Position: #118 / 153
  • Number of attempts: 2
Space out the alphabet - 1690 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 19
  • Position: #250 / 454
  • Number of attempts: 1
Mute the second method of this script - 460 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 9
  • Position: #89 / 242
  • Number of attempts: 2
Pretty format for variable declarations - 183 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 13
  • Best player score: 20
  • Position: #55 / 66
  • Number of attempts: 1
I forgot quotes - 16179 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1259 / 4218
  • Number of attempts: 3
learn vim in short time - 245 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #73 / 165
  • Number of attempts: 2
-a-b-c- - 3233 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #106 / 1143
  • Number of attempts: 3
Gray area - 754 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Position: #175 / 273
  • Number of attempts: 3
Neither Fizz nor Buzz - 270 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #79 / 106
  • Number of attempts: 1
Don't know what this is - 2044 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: 13
  • Position: #263 / 591
  • Number of attempts: 2
Where should I put the Newline? - 897 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #150 / 445
  • Number of attempts: 2
Ninjas Leaderboard - 111 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: 35
  • Position: #28 / 43
  • Number of attempts: 1
Letter case trickery - 1663 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: 14
  • Position: #442 / 522
  • Number of attempts: 1
Words in parens - 13032 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #154 / 3986
  • Number of attempts: 6
Delete unwanted lines - 441 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #150 / 235
  • Number of attempts: 2
The name of the game - 682 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #192 / 366
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1641 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #70 / 456
  • Number of attempts: 5
Vertical Limit - 2629 entries

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

  • Best score: 21
  • Best player score: 28
  • Position: #604 / 775
  • Number of attempts: 1
replacing each line of a block selection - 3041 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 18
  • Position: #48 / 786
  • Number of attempts: 10
Switch function arguments - 2197 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #75 / 679
  • Number of attempts: 6
Remove semicolons after expressions - 671 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #81 / 266
  • Number of attempts: 2
switch variable - 5114 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #868 / 1759
  • Number of attempts: 1
remove dupes from array - 1362 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 21
  • Position: #152 / 339
  • Number of attempts: 3
Numbering a List - 1942 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 25
  • Position: #550 / 658
  • Number of attempts: 1
A Simple One - 1077 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: #409 / 676
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3985 entries

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

  • Best score: 16
  • Best player score: 23
  • Position: #388 / 852
  • Number of attempts: 4
Simple text editing with Vim - 13526 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #204 / 3879
  • Number of attempts: 4
Jack Z
Twitter:

:(){:|:&};:

entered into 36 challenges

contributed 0 challenges