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

HS Final exam vimgolf - 897 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: #131 / 236
  • Number of attempts: 1
Rural Post - 4468 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #216 / 1095
  • Number of attempts: 3
Add quotes to ansible playbook - 952 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #84 / 304
  • Number of attempts: 5
Multiline to Single Line - 700 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #10 / 302
  • Number of attempts: 1
xrandr outputs and dashes - 704 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: #51 / 221
  • Number of attempts: 5
Yo To Hello - 1130 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #139 / 524
  • Number of attempts: 1
Replace pattern with 1, 2, 3, ... on each line - 1146 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: 21
  • Position: #19 / 229
  • Number of attempts: 8
Simple, Practical, and Common - 33586 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: 22
  • Position: #1634 / 7409
  • Number of attempts: 7
prepend * to every non-blank line - 6304 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #218 / 1536
  • Number of attempts: 7
One number per line - 18711 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #662 / 3858
  • Number of attempts: 13
Quote modules - 1073 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 32
  • Position: #229 / 280
  • Number of attempts: 1
Unsemantic linewrapping - 926 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: 10
  • Position: #141 / 230
  • Number of attempts: 7
V to the i - 4798 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #733 / 1891
  • Number of attempts: 4
Add semicolons - 10848 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1488 / 3061
  • Number of attempts: 3
Com(m)a Trouble - 3796 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #117 / 860
  • Number of attempts: 7
Search and Replace 0 - 4976 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #653 / 1620
  • Number of attempts: 3
Just the middle - 11423 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3074 / 4185
  • Number of attempts: 1
Vice versa - 7903 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #402 / 2125
  • Number of attempts: 5
One to Ten - 2209 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: #46 / 669
  • Number of attempts: 7
Build a six - 294 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 22
  • Position: #16 / 95
  • Number of attempts: 6
Delete to the end of the current line - 810 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #233 / 389
  • Number of attempts: 2
Array transposition - 2416 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 16
  • Position: #31 / 447
  • Number of attempts: 25
Not enough Ps - 67 entries

Different type of code

  • Best score: 13
  • Best player score: 13
  • Position: #23 / 36
  • Number of attempts: 1
I forgot quotes - 15974 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1383 / 4175
  • Number of attempts: 3
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #289 / 1137
  • Number of attempts: 4
quotes inside quotes - 3157 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: 14
  • Position: #341 / 1076
  • Number of attempts: 5
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1107 / 3960
  • Number of attempts: 3
Simple text editing with Vim - 12712 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #635 / 3671
  • Number of attempts: 3
Jan Sturm
Twitter:

entered into 28 challenges

contributed 0 challenges