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 - 1737 entries

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

  • Best score: 14
  • Best player score: 23
  • Position: #111 / 290
  • Number of attempts: 4
Quicksort - 2095 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: #138 / 465
  • Number of attempts: 1
Paste a column after a column - 2662 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #127 / 576
  • Number of attempts: 9
Many duplicates - 1472 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #321 / 480
  • Number of attempts: 3
Inverting Lines - 1952 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 11
  • Position: #278 / 522
  • Number of attempts: 3
Simple, Practical, and Common - 33929 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: #2415 / 7489
  • Number of attempts: 9
One number per line - 18840 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #2032 / 3893
  • Number of attempts: 5
multiple cursor alternative - 1547 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: 20
  • Position: #200 / 385
  • Number of attempts: 14
Just the middle - 11555 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1513 / 4234
  • Number of attempts: 3
Vice versa - 7981 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #861 / 2147
  • Number of attempts: 7
Change attribute to getter - 163 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 24
  • Position: #35 / 64
  • Number of attempts: 8
Delete to the end of the current line - 865 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 6
  • Position: #381 / 415
  • Number of attempts: 2
I forgot quotes - 16127 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #3104 / 4208
  • Number of attempts: 5
quotes inside quotes - 3185 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 15
  • Position: #516 / 1086
  • Number of attempts: 5
Get rid of html tags - 441 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 12
  • Best player score: 16
  • Position: #28 / 252
  • Number of attempts: 3
zhs
Github:

entered into 15 challenges

contributed 0 challenges