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

hello-world-vimgolf - 2533 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #5 / 726
  • Number of attempts: 3
Modernise code - 1439 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #36 / 333
  • Number of attempts: 10
Rural Post - 4602 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #169 / 1124
  • Number of attempts: 7
Satisfy the go linter - 2487 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 20
  • Position: #105 / 496
  • Number of attempts: 7
Add quotes to ansible playbook - 1049 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 8
  • Position: #47 / 332
  • Number of attempts: 7
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: #143 / 322
  • Number of attempts: 2
xrandr outputs and dashes - 753 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 12
  • Position: #115 / 229
  • Number of attempts: 1
Yo To Hello - 1156 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #320 / 537
  • Number of attempts: 2
Get mail address from outlook format - 660 entries

Create a mail list space separated of mail list formatted by outlook

  • Best score: 15
  • Best player score: 15
  • Position: #65 / 207
  • Number of attempts: 7
Swap values - 4705 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #349 / 1293
  • Number of attempts: 6
prepend * to every non-blank line - 6395 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 11
  • Position: #736 / 1562
  • Number of attempts: 6
One number per line - 18903 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Position: #1044 / 3904
  • Number of attempts: 6
Unsemantic linewrapping - 964 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

  • Best score: 9
  • Best player score: 9
  • Position: #91 / 238
  • Number of attempts: 5
V to the i - 4883 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #772 / 1914
  • Number of attempts: 2
Applying same text modification in several lines - 2931 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 12
  • Position: #8 / 867
  • Number of attempts: 5
Add semicolons - 10956 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #728 / 3098
  • Number of attempts: 4
remove lines containing the word "reader" - 3652 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #478 / 1185
  • Number of attempts: 3
Two pairs of cluster of letters creates word - 773 entries

Clean and group.

  • Best score: 17
  • Best player score: 25
  • Position: #152 / 182
  • Number of attempts: 1
Every other line - 2951 entries

AaAaAaA

  • Best score: 12
  • Best player score: 12
  • Position: #78 / 712
  • Number of attempts: 8
Search and Replace 0 - 5159 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #673 / 1674
  • Number of attempts: 5
Just the middle - 11616 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1473 / 4255
  • Number of attempts: 2
ninja substitution - 1439 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Position: #76 / 271
  • Number of attempts: 5
One to Ten - 2258 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 12
  • Position: #335 / 688
  • Number of attempts: 3
Line under headers - 2095 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 34
  • Position: #376 / 515
  • Number of attempts: 1
Array transposition - 2481 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 16
  • Position: #40 / 461
  • Number of attempts: 10
Space out the alphabet - 1692 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 25
  • Position: #403 / 456
  • Number of attempts: 1
I forgot quotes - 16237 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #1116 / 4224
  • Number of attempts: 8
A HAPPY NEW YEAR 2014 ! - 10755 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1580 / 3715
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1642 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: #116 / 457
  • Number of attempts: 9
Ruby 1.9 compat - 661 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 14
  • Position: #64 / 241
  • Number of attempts: 3
Context insensitive completion 0 - 605 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: #110 / 255
  • Number of attempts: 2
Reverse characters in a line - 844 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 8
  • Best player score: 24
  • Position: #241 / 282
  • Number of attempts: 1
Simple text editing with Vim - 13626 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #655 / 3902
  • Number of attempts: 5
vim_maxter
Twitter:

entered into 33 challenges

contributed 0 challenges