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

Learn some german verbs - 393 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
  • Number of attempts: 2
multiple cursor alternative - 1083 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
  • Number of attempts: 1
Reformat long lines - 316 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
  • Number of attempts: 3
Deleting folded text - 274 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
  • Number of attempts: 1
Array Transposition - 141 entries

Transpose four arrays into two.

  • Best score: 27
  • Best player score: 54
  • Number of attempts: 1
Test everything! - 111 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
  • Number of attempts: 2
One number per line - 13045 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 22
  • Number of attempts: 1
Split line with dots - 1840 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 25
  • Number of attempts: 2
I forgot quotes - 11966 entries

Oops.

  • Best score: 10
  • Best player score: 21
  • Number of attempts: 1
Vertical Limit - 2124 entries

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

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 6
Saving the hashes(#) - 1765 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
  • Number of attempts: 7
Space out the alphabet - 1381 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 5
Align commas - 854 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
  • Number of attempts: 4
Winning streak - 105 entries

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

  • Best score: 21
  • Best player score: 37
  • Number of attempts: 3
Simple, Practical, and Common - 25355 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
  • Number of attempts: 2
Fiddle percentages into real numbers - 723 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
  • Number of attempts: 2
Format java properties - 63 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
  • Number of attempts: 1
From argument to object - 1113 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
  • Number of attempts: 2
switch variable - 4324 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
comment and uncomment code inline - 820 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
  • Number of attempts: 3
Collect List - 3533 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 17
  • Number of attempts: 3
Sorting a glossary - 101 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
  • Number of attempts: 1
comments galore - 906 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Number Sort - 243 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
  • Number of attempts: 2
Whitespace, empty lines and tabs - 2554 entries

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

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 11
-a-b-c- - 2611 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
Missing Library and a Typo - 710 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
  • Number of attempts: 2
Copy three lines - 2085 entries

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

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 5
Refactor arguments into object argument - 156 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 84
  • Number of attempts: 1
Simple text editing with Vim - 10466 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
Com(m)a Trouble - 1787 entries

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

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
Adam's challenge - 798 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
  • Number of attempts: 6
That hyphen - 2201 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Swap values inside brackets - 1533 entries

Easy challenge.

  • Best score: 14
  • Best player score: 18
  • Number of attempts: 2
abcd > a b c d - 241 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 2
Words in parens - 11108 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 17
  • Number of attempts: 2
Stairs Indenting - 360 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 20
  • Number of attempts: 2
vg
Twitter:

entered into 37 challenges

contributed 0 challenges