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

Box it - 3296 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 4
From argument to object - 1113 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 4
ninja substitution - 629 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 4
One number per line - 13098 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 7
quotes inside quotes - 2799 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: 14
  • Number of attempts: 4
That hyphen - 2201 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 5
Vice versa - 6001 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 5
I forgot quotes - 11994 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 6
comment and uncomment code inline - 820 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
  • Number of attempts: 4
remove lines containing the word "reader" - 1751 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Add semicolons - 2260 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Adam's challenge - 802 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 4
Swap values inside brackets - 1533 entries

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 6
A HAPPY NEW YEAR 2014 ! - 9560 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
One to Ten - 1022 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 3
-a-b-c- - 2617 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Search and Replace 0 - 4148 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
BunFluffman
Twitter:

entered into 17 challenges

contributed 0 challenges