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 - 33354 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: 26
  • Position: #3584 / 7358
  • Number of attempts: 2
One number per line - 18615 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 22
  • Position: #2706 / 3841
  • Number of attempts: 1
Swap values inside brackets - 2464 entries

Easy challenge.

  • Best score: 14
  • Best player score: 18
  • Position: #324 / 569
  • Number of attempts: 2
Split line with dots - 2124 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 25
  • Position: #525 / 629
  • Number of attempts: 2
Com(m)a Trouble - 3654 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #441 / 821
  • Number of attempts: 1
multiple cursor alternative - 1474 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 26
  • Position: #311 / 376
  • Number of attempts: 1
From argument to object - 1474 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 20
  • Position: #333 / 450
  • Number of attempts: 2
Copy three lines - 2839 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #283 / 634
  • Number of attempts: 5
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: #78 / 162
  • Number of attempts: 2
That hyphen - 2554 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #189 / 694
  • Number of attempts: 3
comment and uncomment code inline - 1069 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 10
  • Position: #186 / 314
  • Number of attempts: 3
Learn some german verbs - 531 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 38
  • Position: #119 / 131
  • Number of attempts: 2
Format java properties - 72 entries

Format java properties to a different format. The value which is the string following the first '=' cannot & should not change. All periods in the key get replaced with an underscore "_" and get a prefix of "b_".

  • Best score: 27
  • Best player score: 40
  • Position: #30 / 33
  • Number of attempts: 1
Missing Library and a Typo - 856 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: 18
  • Position: #133 / 209
  • Number of attempts: 2
Adam's challenge - 950 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 18
  • Position: #72 / 265
  • Number of attempts: 6
Fiddle percentages into real numbers - 840 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 13
  • Position: #120 / 287
  • Number of attempts: 2
Sorting a glossary - 118 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

  • Best score: 6
  • Best player score: 6
  • Position: #61 / 76
  • Number of attempts: 1
comments galore - 998 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #261 / 418
  • Number of attempts: 2
Align commas - 1049 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

  • Best score: 11
  • Best player score: 15
  • Position: #124 / 241
  • Number of attempts: 4
Collect List - 4261 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 17
  • Position: #984 / 1185
  • Number of attempts: 3
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Position: #117 / 440
  • Number of attempts: 5
Winning streak - 124 entries

Make the number on each line equal the consecutive L's or W's.

  • Best score: 21
  • Best player score: 37
  • Position: #39 / 49
  • Number of attempts: 3
Test everything! - 162 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 36
  • Position: #39 / 52
  • Number of attempts: 2
I forgot quotes - 15923 entries

Oops.

  • Best score: 10
  • Best player score: 21
  • Position: #3723 / 4159
  • Number of attempts: 1
-a-b-c- - 3170 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #999 / 1127
  • Number of attempts: 1
Words in parens - 12850 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2697 / 3944
  • Number of attempts: 2
Refactor arguments into object argument - 161 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 84
  • Position: #57 / 65
  • Number of attempts: 1
abcd > a b c d - 279 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 18
  • Position: #212 / 217
  • Number of attempts: 2
Stairs Indenting - 446 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 20
  • Position: #177 / 193
  • Number of attempts: 2
Array Transposition - 177 entries

Transpose four arrays into two.

  • Best score: 27
  • Best player score: 54
  • Position: #42 / 53
  • Number of attempts: 1
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: #117 / 473
  • Number of attempts: 7
Vertical Limit - 2436 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 21
  • Position: #73 / 735
  • Number of attempts: 6
switch variable - 5028 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1214 / 1734
  • Number of attempts: 1
Reformat long lines - 341 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

  • Best score: 15
  • Best player score: 26
  • Position: #129 / 130
  • Number of attempts: 3
Deleting folded text - 338 entries

The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.

  • Best score: 17
  • Best player score: 26
  • Position: #96 / 113
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3290 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 17
  • Position: #117 / 729
  • Number of attempts: 11
Simple text editing with Vim - 12233 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1672 / 3567
  • Number of attempts: 2
vg
Twitter:

entered into 37 challenges

contributed 0 challenges