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 - 1832 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: #119 / 308
  • Number of attempts: 4
Quicksort - 2114 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 / 473
  • Number of attempts: 1
Paste a column after a column - 2672 entries

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

  • Best score: 7
  • Best player score: 15
  • Position: #128 / 580
  • Number of attempts: 9
Many duplicates - 1489 entries

Quick and easy

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #281 / 527
  • Number of attempts: 3
Simple, Practical, and Common - 34031 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 / 7520
  • Number of attempts: 9
One number per line - 18907 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #2039 / 3907
  • Number of attempts: 5
multiple cursor alternative - 1592 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: #201 / 388
  • Number of attempts: 14
Just the middle - 11636 entries

Delete the instructions at the top and bottom.

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

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #864 / 2158
  • Number of attempts: 7
Change attribute to getter - 182 entries

Wrap attributes with a getter method.

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

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

  • Best score: 5
  • Best player score: 6
  • Position: #384 / 435
  • Number of attempts: 2
I forgot quotes - 16255 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #3117 / 4229
  • Number of attempts: 5
quotes inside quotes - 3210 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: 7
  • Best player score: 15
  • Position: #522 / 1097
  • Number of attempts: 5
Get rid of html tags - 466 entries

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

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

entered into 15 challenges

contributed 0 challenges