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

delete swap - 1443 entries

delete all swap

  • Best score: 5
  • Best player score: 6
  • Position: #324 / 458
  • Number of attempts: 1
hello-world-vimgolf - 2291 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #7 / 647
  • Number of attempts: 3
Making 3 line function a one liner. - 300 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #8 / 190
  • Number of attempts: 1
HS Final exam vimgolf - 852 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 28
  • Position: #123 / 224
  • Number of attempts: 1
Rural Post - 4342 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #528 / 1062
  • Number of attempts: 1
Add quotes to ansible playbook - 867 entries

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

  • Best score: 8
  • Best player score: 12
  • Position: #255 / 273
  • Number of attempts: 1
Multiline to Single Line - 594 entries

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

  • Best score: 5
  • Best player score: 7
  • Position: #239 / 266
  • Number of attempts: 1
Yo To Hello - 1104 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 12
  • Position: #437 / 510
  • Number of attempts: 1
Simple, Practical, and Common - 33342 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: 34
  • Position: #6231 / 7355
  • Number of attempts: 1
prepend * to every non-blank line - 6191 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #819 / 1512
  • Number of attempts: 2
Unsemantic linewrapping - 888 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: 15
  • Position: #194 / 223
  • Number of attempts: 1
Swap the operands under comparison - 270 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 37
  • Position: #90 / 98
  • Number of attempts: 1
Add semicolons - 10780 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1554 / 3041
  • Number of attempts: 3
Bad Copy Syntax - 1992 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 32
  • Position: #433 / 512
  • Number of attempts: 1
Split line with dots - 2124 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 30
  • Position: #592 / 629
  • Number of attempts: 1
Com(m)a Trouble - 3634 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 18
  • Position: #557 / 814
  • Number of attempts: 2
Box it - 7818 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 29
  • Position: #1273 / 1861
  • Number of attempts: 1
Array propagate - 319 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 41
  • Position: #102 / 115
  • Number of attempts: 1
Team names - 1805 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 20
  • Position: #463 / 581
  • Number of attempts: 1
Stairstep digits - 376 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #63 / 141
  • Number of attempts: 2
Missing Library and a Typo - 846 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

  • Best score: 15
  • Best player score: 23
  • Position: #181 / 208
  • Number of attempts: 1
Create a table - 325 entries

Convert the given input into a formatted table

  • Best score: 16
  • Best player score: 24
  • Position: #91 / 104
  • Number of attempts: 1
A grid of punctuation - 124 entries

Create a checkerboard of = and - in an 80×24 grid!

  • Best score: 16
  • Best player score: 21
  • Position: #50 / 57
  • Number of attempts: 2
One to Ten - 2156 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: 15
  • Position: #504 / 659
  • Number of attempts: 1
Line under headers - 1983 entries

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

  • Best score: 24
  • Best player score: 37
  • Position: #393 / 492
  • Number of attempts: 1
Around the clock - 188 entries

You'll want to use 2 special commands to complete this. If you haven't yet, read through 'input.txt', especially :help simple-changes

  • Best score: 13
  • Best player score: 17
  • Position: #69 / 74
  • Number of attempts: 1
Join 'em - 246 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 7
  • Position: #143 / 146
  • Number of attempts: 1
Delete to the end of the current line - 738 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 6
  • Position: #269 / 363
  • Number of attempts: 2
Song Transcription Oops - 234 entries

When transcribing vocal music to Canjo Tab you can start by finding the lowest note and assigning that to zero and working your way up from there. However, without fail, I tend to miscount the notes and when I am near done I find a lower note. I mark this with a "z". This means I have to increase all the previous ones by 1. just a sting of numbers :)

  • Best score: 15
  • Best player score: 27
  • Position: #64 / 75
  • Number of attempts: 1
change parenthesis - 278 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 10
  • Position: #104 / 156
  • Number of attempts: 1
Put the months in order - 932 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

  • Best score: 20
  • Best player score: 50
  • Position: #120 / 158
  • Number of attempts: 1
Array transposition - 2378 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 74
  • Position: #434 / 443
  • Number of attempts: 1
convert yml into java pojo field - 829 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

  • Best score: 29
  • Best player score: 36
  • Position: #184 / 223
  • Number of attempts: 1
unknown command - 158 entries

I want change 5 words

  • Best score: 7
  • Best player score: 7
  • Position: #18 / 83
  • Number of attempts: 2
Array Transposition - 177 entries

Transpose four arrays into two.

  • Best score: 27
  • Best player score: 55
  • Position: #44 / 53
  • Number of attempts: 1
citizen_hacks_2019_challenge1 - 48 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 5
  • Best player score: 5
  • Position: #10 / 42
  • Number of attempts: 2
Miki Tebeka
Twitter:

CEO of 353solutions. We deliver world class, effective, hands-on workshops. https://t.co/8buqm35iGh

entered into 36 challenges

contributed 0 challenges