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

Inverting Lines - 1959 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 15
  • Position: #392 / 525
  • Number of attempts: 6
RUST match with enum for Coin - 196 entries

RUST match with enum for Coin rusty practice on vimgolf

  • Best score: 84
  • Best player score: 137
  • Position: #47 / 56
  • Number of attempts: 4
swap number pairs - 2173 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 37
  • Position: #311 / 394
  • Number of attempts: 6
Easy modification of ssh config - 400 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 54
  • Position: #98 / 118
  • Number of attempts: 4
Rural Post - 4596 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 28
  • Position: #1004 / 1122
  • Number of attempts: 1
Multiline to Single Line - 754 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #133 / 322
  • Number of attempts: 12
Yo To Hello - 1155 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #312 / 536
  • Number of attempts: 5
Replace pattern with 1, 2, 3, ... on each line - 1161 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

  • Best score: 21
  • Best player score: 38
  • Position: #184 / 235
  • Number of attempts: 5
Wrap the text of an email message to 79 characters - 864 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #259 / 449
  • Number of attempts: 7
Search and Replace 0 - 5124 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #672 / 1670
  • Number of attempts: 11
Interweave two blocks of text - 675 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: 20
  • Position: #180 / 216
  • Number of attempts: 16
Python Hello World! Reformatting - 1022 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: 46
  • Position: #316 / 391
  • Number of attempts: 4
NATO phonetic alphabet - 547 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 19
  • Position: #44 / 199
  • Number of attempts: 9
The Quick Brown Fox Jumps Over The Lazy Vim - 445 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 10
  • Position: #97 / 198
  • Number of attempts: 16
The name of the game - 682 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #258 / 366
  • Number of attempts: 3
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: #118 / 456
  • Number of attempts: 13
Vertical Limit - 2634 entries

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

  • Best score: 21
  • Best player score: 24
  • Position: #315 / 776
  • Number of attempts: 10
replacing each line of a block selection - 3050 entries

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

  • Best score: 18
  • Best player score: 35
  • Position: #743 / 787
  • Number of attempts: 6
Switch function arguments - 2204 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #181 / 681
  • Number of attempts: 12
Append semicolon after expressions - 1071 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #130 / 425
  • Number of attempts: 16
Remove noise from HTTP log - 742 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #136 / 280
  • Number of attempts: 12
Remove semicolons after expressions - 676 entries

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

  • Best score: 6
  • Best player score: 6
  • Position: #115 / 268
  • Number of attempts: 6
Sort the cardinal numbers - 326 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 12
  • Position: #52 / 150
  • Number of attempts: 13
Case preserving word replacement - 476 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 19
  • Position: #63 / 185
  • Number of attempts: 8
imports alignment (python) - 719 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 53
  • Position: #197 / 201
  • Number of attempts: 4
It'ss tooo coold too typpe todaay - 237 entries

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

  • Best score: 16
  • Best player score: 23
  • Position: #70 / 100
  • Number of attempts: 4
HTML to Haml - 905 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 44
  • Position: #142 / 207
  • Number of attempts: 3
Numbering a List - 1944 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #61 / 659
  • Number of attempts: 12
Assignment Alignment - 905 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 24
  • Position: #117 / 226
  • Number of attempts: 16
Shebangs for all - 2098 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 17
  • Position: #372 / 531
  • Number of attempts: 14
A Simple One - 1079 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: #515 / 677
  • Number of attempts: 2
Hatsuyume - 564 entries

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

  • Best score: 15
  • Best player score: 25
  • Position: #91 / 193
  • Number of attempts: 12
Reformat a C golf submission - 644 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: 40
  • Position: #182 / 216
  • Number of attempts: 8
Reformat most common surnames - 822 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 75
  • Position: #222 / 236
  • Number of attempts: 3
Change the content of a string - 1779 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #190 / 651
  • Number of attempts: 10
Add fold markers to a .c file - 721 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 30
  • Best player score: 35
  • Position: #108 / 201
  • Number of attempts: 12
Whitespace, empty lines and tabs - 4025 entries

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

  • Best score: 16
  • Best player score: 21
  • Position: #260 / 857
  • Number of attempts: 11
Simple text editing with Vim - 13576 entries

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

  • Best score: 13
  • Best player score: 19
  • Position: #2869 / 3892
  • Number of attempts: 9
Reformat/Refactor a Golfer Class - 7649 entries

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

  • Best score: 7
  • Best player score: 46
  • Position: #1296 / 1882
  • Number of attempts: 7
Scott Atkins
Twitter:

eat, run, code!

entered into 39 challenges

contributed 0 challenges