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 - 33591 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 / 7410
  • Number of attempts: 6
One number per line - 18711 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #1910 / 3858
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 195 entries

For the Citizen Hacks 2019 Vim competition.

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

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #49 / 577
  • Number of attempts: 6
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: 9
  • Position: #33 / 230
  • Number of attempts: 4
Applying same text modification in several lines - 2870 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #183 / 848
  • Number of attempts: 4
Add string initializers to an enum - 872 entries

Change Typescript enum so that it has string initializers.

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

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1007 / 3061
  • Number of attempts: 3
Bad Copy Syntax - 2028 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #105 / 522
  • Number of attempts: 3
Split line with dots - 2144 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 17
  • Position: #259 / 634
  • Number of attempts: 5
remove lines containing the word "reader" - 3574 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #654 / 1158
  • Number of attempts: 1
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: #60 / 860
  • Number of attempts: 7
Extract wireshark capture filter - 215 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 32
  • Position: #55 / 71
  • Number of attempts: 5
Box it - 7902 entries

Create a box around a line.

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

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

  • Best score: 21
  • Best player score: 21
  • Position: #10 / 25
  • Number of attempts: 2
Copy three lines - 2872 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 / 640
  • Number of attempts: 8
Number Sort - 314 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 / 166
  • Number of attempts: 1
Just the middle - 11424 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2913 / 4186
  • Number of attempts: 2
Basic renumbering - 5645 entries

Renumbering Basic.

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

How can you reuse a previous substitution ?

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

Little role switching.

  • Best score: 12
  • Best player score: 18
  • Position: #1771 / 2125
  • Number of attempts: 1
citizen_hacks_2019_challenge4 - 95 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 5
  • Best player score: 5
  • Position: #5 / 65
  • Number of attempts: 1
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: #165 / 669
  • Number of attempts: 3
citizen_hacks_2019_challenge5 - 147 entries

For the Citizen Hacks 2019 Vim competition.

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

For the Citizen Hacks 2019 Vim competition.

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

This shouldn't be too tough

  • Best score: 4
  • Best player score: 5
  • Position: #106 / 151
  • Number of attempts: 1
Remove quotes after first field - 380 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #16 / 91
  • Number of attempts: 7
Put the months in order - 974 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 / 163
  • Number of attempts: 12
Reorder the groups - 1181 entries

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

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

Oops.

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

Put hyphens everywhere.

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

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #125 / 354
  • Number of attempts: 3
Don't know what this is - 2014 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: #248 / 582
  • Number of attempts: 3
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1019 / 3960
  • Number of attempts: 3
Resort and deup a CSV list - 167 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: #29 / 43
  • Number of attempts: 1
ASCII-art Histogram - 320 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: #25 / 57
  • Number of attempts: 8
Saving the hashes(#) - 2053 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: #121 / 479
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6901 entries

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

  • Best score: 28
  • Best player score: 43
  • Position: #1045 / 1690
  • Number of attempts: 3
Zach Ingbretsen
Twitter:

entered into 38 challenges

contributed 0 challenges