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

Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Position: #811 / 1268
  • Number of attempts: 1
Prime Numbers - 374 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 39
  • Position: #24 / 105
  • Number of attempts: 14
Python Hello World! Reformatting - 994 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: #77 / 380
  • Number of attempts: 2
VimGolfNight - 560 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #29 / 347
  • Number of attempts: 2
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: #530 / 1078
  • Number of attempts: 2
Printable ASCII characters - 142 entries

From a blank input, print all 95 printing ASCII characters one per line, from space to tilde.

  • Best score: 22
  • Best player score: 45
  • Position: #34 / 44
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1606 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #163 / 446
  • Number of attempts: 4
Stairs Indenting - 473 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #72 / 197
  • Number of attempts: 2
Flip the chessboard - 95 entries

White's turn is over. Flip the board to black's perspective. I added coordinates to frustrate you.

  • Best score: 18
  • Best player score: 30
  • Position: #22 / 32
  • Number of attempts: 4
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #372 / 650
  • Number of attempts: 1
It'ss tooo coold too typpe todaay - 224 entries

My hands are numb with cold. It's hard to type correctly.

  • Best score: 16
  • Best player score: 24
  • Position: #72 / 98
  • Number of attempts: 1
Round Round - 321 entries

Round Round

  • Best score: 19
  • Best player score: 88
  • Position: #61 / 88
  • Number of attempts: 2
Hatsuyume - 532 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 15
  • Best player score: 26
  • Position: #90 / 186
  • Number of attempts: 4
Turn this csv list into queries - 252 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

  • Best score: 98
  • Best player score: 139
  • Position: #75 / 101
  • Number of attempts: 2
Context insensitive completion 0 - 577 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Position: #5 / 246
  • Number of attempts: 4
Context Insensitive completion 1 - 498 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #1 / 245
  • Number of attempts: 1
Linear congruential generator - 142 entries

http://en.wikipedia.org/wiki/Linear_congruential_generator

  • Best score: 28
  • Best player score: 105
  • Position: #50 / 53
  • Number of attempts: 2
Reformat some Python - 609 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 35
  • Position: #46 / 236
  • Number of attempts: 4
Reformat a C golf submission - 604 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 27
  • Position: #43 / 208
  • Number of attempts: 6
PEP8 Python Wrapping Comments and Code - 210 entries

According to PEP8, long flowy text and code should have different max line lengths. Code: 79 characters max Long flowy text: 72 characters max

  • Best score: 21
  • Best player score: 32
  • Position: #45 / 67
  • Number of attempts: 5
Reconstruct the Sentence - 1507 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 20
  • Best player score: 21
  • Position: #155 / 412
  • Number of attempts: 5
Braces or Brackets? - 1015 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 44
  • Position: #141 / 315
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 6982 entries

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

  • Best score: 28
  • Best player score: 36
  • Position: #403 / 1706
  • Number of attempts: 6

Contributed Challenges

Linear congruential generator - 142 entries

http://en.wikipedia.org/wiki/Linear_congruential_generator

Hatsuyume - 532 entries

http://en.wikipedia.org/wiki/Hatsuyume

Round Round - 321 entries

Round Round

It'ss tooo coold too typpe todaay - 224 entries

My hands are numb with cold. It's hard to type correctly.

kana
Twitter:

do { edit(Vim); love(Doll, 37); photo(Pentax(31, 43, 77)); diy(); ride(Carrera("Phibra Evo"), km(1982.29)); game("Nintendo Switch"); } while ("im automaton");

entered into 23 challenges

contributed 4 challenges