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 - 1829 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: #118 / 307
  • Number of attempts: 4
Quicksort - 2113 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 / 472
  • Number of attempts: 1
Paste a column after a column - 2668 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 / 578
  • Number of attempts: 9
Many duplicates - 1488 entries

Quick and easy

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #280 / 526
  • Number of attempts: 3
Simple, Practical, and Common - 34012 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 / 7513
  • Number of attempts: 9
One number per line - 18903 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #2038 / 3904
  • Number of attempts: 5
multiple cursor alternative - 1591 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 - 11616 entries

Delete the instructions at the top and bottom.

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

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #863 / 2157
  • 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 - 882 entries

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

  • Best score: 5
  • Best player score: 6
  • Position: #382 / 418
  • Number of attempts: 2
I forgot quotes - 16237 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #3115 / 4224
  • Number of attempts: 5
quotes inside quotes - 3202 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: #519 / 1093
  • Number of attempts: 5
Get rid of html tags - 463 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 / 261
  • Number of attempts: 3
zhs
Github:

entered into 15 challenges

contributed 0 challenges