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

Simple, Practical, and Common - 33379 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: #1895 / 7363
  • Number of attempts: 6
One number per line - 18616 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #1903 / 3842
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 189 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #5 / 99
  • Number of attempts: 1
Swap values inside brackets - 2464 entries

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #49 / 569
  • Number of attempts: 6
Unsemantic linewrapping - 890 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: #33 / 224
  • Number of attempts: 4
Applying same text modification in several lines - 2845 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #180 / 840
  • Number of attempts: 4
Add string initializers to an enum - 862 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 21
  • Position: #3 / 254
  • Number of attempts: 6
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1004 / 3044
  • Number of attempts: 3
Bad Copy Syntax - 2001 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #102 / 516
  • Number of attempts: 3
Split line with dots - 2125 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 17
  • Position: #258 / 630
  • Number of attempts: 5
remove lines containing the word "reader" - 3537 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #648 / 1144
  • Number of attempts: 1
Com(m)a Trouble - 3668 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #60 / 826
  • Number of attempts: 7
Extract wireshark capture filter - 198 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 32
  • Position: #53 / 67
  • Number of attempts: 5
Box it - 7827 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #178 / 1864
  • Number of attempts: 8
Hash staircase - 48 entries

Can you use a strategy to come up with this pattern?

  • Best score: 21
  • Best player score: 21
  • Position: #10 / 22
  • Number of attempts: 2
Copy three lines - 2840 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 13
  • Position: #135 / 635
  • Number of attempts: 8
Number Sort - 303 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Position: #108 / 162
  • Number of attempts: 1
Just the middle - 11358 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2910 / 4163
  • Number of attempts: 2
Basic renumbering - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #183 / 1258
  • Number of attempts: 1
ninja substitution - 1372 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Position: #44 / 261
  • Number of attempts: 7
Vice versa - 7797 entries

Little role switching.

  • Best score: 12
  • Best player score: 18
  • Position: #1755 / 2099
  • Number of attempts: 1
citizen_hacks_2019_challenge4 - 88 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 5
  • Best player score: 5
  • Position: #5 / 61
  • Number of attempts: 1
One to Ten - 2165 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: #165 / 662
  • Number of attempts: 3
citizen_hacks_2019_challenge5 - 137 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #3 / 73
  • Number of attempts: 2
citizen_hacks_2019_challenge6 - 59 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 3
  • Best player score: 3
  • Position: #9 / 47
  • Number of attempts: 1
Join 'em - 248 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 5
  • Position: #103 / 148
  • Number of attempts: 1
Remove quotes after first field - 353 entries

Remove the quotes around each field except for the first field.

  • Best score: 16
  • Best player score: 16
  • Position: #16 / 87
  • Number of attempts: 7
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: 20
  • Position: #5 / 158
  • Number of attempts: 12
Reorder the groups - 1137 entries

Change the order so that the groups of fruit come before the vegetables.

  • Best score: 14
  • Best player score: 14
  • Position: #46 / 259
  • Number of attempts: 3
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #914 / 4161
  • Number of attempts: 6
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #263 / 1129
  • Number of attempts: 3
Count both ways - 1001 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #123 / 351
  • Number of attempts: 3
Don't know what this is - 1978 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 13
  • Position: #244 / 578
  • Number of attempts: 3
Words in parens - 12854 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1015 / 3945
  • Number of attempts: 3
Resort and deup a CSV list - 142 entries

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

  • Best score: 44
  • Best player score: 62
  • Position: #25 / 39
  • Number of attempts: 1
ASCII-art Histogram - 310 entries

Create an ASCCI-art histogram for the given numbers. Make sure not to leave trailing whitespaces. Thanks to VimGolf I recently discovered a feature of Vim thAT blew my mind. I'm curious to see what real ninjas make of it ;-)

  • Best score: 33
  • Best player score: 35
  • Position: #23 / 55
  • Number of attempts: 8
Saving the hashes(#) - 1992 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 21
  • Position: #119 / 473
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6557 entries

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

  • Best score: 32
  • Best player score: 43
  • Position: #1010 / 1614
  • Number of attempts: 3
Zach Ingbretsen
Twitter:

entered into 38 challenges

contributed 0 challenges