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

Rearrange array to single level - 1528 entries

The goal is to flatten the array into a single list and remove any empty elements.

  • Best score: 14
  • Best player score: 15
  • Position: #18 / 254
  • Number of attempts: 13
Rearrange array to one line - 719 entries

Rearrange the array content on only one line, and remove trailing commas

  • Best score: 13
  • Best player score: 17
  • Position: #56 / 174
  • Number of attempts: 4
Quicksort - 2038 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 6
  • Position: #128 / 452
  • Number of attempts: 6
Surround the 'z' character with brackets, quotes, and print as formatted string. - 570 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #234 / 319
  • Number of attempts: 1
Paste a column after a column - 2610 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 14
  • Position: #108 / 566
  • Number of attempts: 6
Reformat symbols in list - 1635 entries

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

  • Best score: 24
  • Best player score: 27
  • Position: #169 / 352
  • Number of attempts: 3
Modernise code - 1410 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 36
  • Position: #107 / 326
  • Number of attempts: 5
swap number pairs - 2128 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 16
  • Position: #59 / 388
  • Number of attempts: 10
Satisfy the go linter - 2450 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 24
  • Position: #259 / 485
  • Number of attempts: 5
Simple, Practical, and Common - 33787 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: #2409 / 7454
  • Number of attempts: 7
Bad Copy Syntax - 2052 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #307 / 534
  • Number of attempts: 3
remove lines containing the word "reader" - 3614 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #866 / 1173
  • Number of attempts: 4
comment and uncomment code inline - 1151 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: 9
  • Position: #164 / 328
  • Number of attempts: 4
Just the middle - 11509 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3215 / 4218
  • Number of attempts: 1
attr_aligner - 3525 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 19
  • Position: #184 / 706
  • Number of attempts: 9
Switch function arguments - 2162 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #197 / 669
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 7258 entries

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

  • Best score: 10
  • Best player score: 39
  • Position: #795 / 1790
  • Number of attempts: 3
Pim
Github:

entered into 17 challenges

contributed 0 challenges