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 - 1499 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: #99 / 248
  • Number of attempts: 4
Quicksort - 2035 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 / 450
  • Number of attempts: 1
Paste a column after a column - 2604 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #122 / 565
  • Number of attempts: 9
Many duplicates - 1459 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #320 / 476
  • Number of attempts: 3
Inverting Lines - 1923 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #275 / 516
  • Number of attempts: 3
Simple, Practical, and Common - 33757 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 / 7450
  • Number of attempts: 9
One number per line - 18780 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #2027 / 3877
  • Number of attempts: 5
multiple cursor alternative - 1542 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 / 384
  • Number of attempts: 14
Just the middle - 11500 entries

Delete the instructions at the top and bottom.

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

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #860 / 2144
  • Number of attempts: 7
Change attribute to getter - 157 entries

Wrap attributes with a getter method.

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

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

  • Best score: 5
  • Best player score: 6
  • Position: #373 / 406
  • Number of attempts: 2
I forgot quotes - 16051 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #3095 / 4194
  • Number of attempts: 5
quotes inside quotes - 3182 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 / 1085
  • Number of attempts: 5
Get rid of html tags - 415 entries

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

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

entered into 15 challenges

contributed 0 challenges