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 - 1296 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: #14 / 204
  • Number of attempts: 13
Rearrange array to one line - 600 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #47 / 143
  • Number of attempts: 4
Quicksort - 1945 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 / 429
  • Number of attempts: 6
Surround the 'z' character with brackets, quotes, and print as formatted string. - 554 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #234 / 309
  • Number of attempts: 1
Paste a column after a column - 2534 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 / 552
  • Number of attempts: 6
Reformat symbols in list - 1614 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #167 / 347
  • Number of attempts: 3
Modernise code - 1400 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 36
  • Position: #106 / 323
  • Number of attempts: 5
swap number pairs - 2103 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #59 / 380
  • Number of attempts: 10
Satisfy the go linter - 2391 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: #257 / 471
  • Number of attempts: 5
Simple, Practical, and Common - 33614 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 / 7418
  • Number of attempts: 7
Bad Copy Syntax - 2037 entries

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

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

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #862 / 1161
  • Number of attempts: 4
comment and uncomment code inline - 1122 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 / 322
  • Number of attempts: 4
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3212 / 4197
  • Number of attempts: 1
attr_aligner - 3516 entries

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

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

How to switch two arguments of a function.

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

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

  • Best score: 28
  • Best player score: 39
  • Position: #776 / 1702
  • Number of attempts: 3
Pim
Github:

entered into 17 challenges

contributed 0 challenges