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

Whitespace, empty lines and tabs - 2599 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 29
  • Number of attempts: 2
Saving the hashes(#) - 1806 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 28
  • Number of attempts: 2
Bad Copy Syntax - 1034 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 19
  • Best player score: 26
  • Number of attempts: 1
Subtraction - 147 entries

Solve the equations.

  • Best score: 18
  • Best player score: 26
  • Number of attempts: 1
Space out the alphabet - 1413 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 25
  • Number of attempts: 1
Box it - 4246 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Number of attempts: 2
switch variable - 4443 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 9
Change name of a variable - 146 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
V to the i - 4110 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 11
change parenthesis - 186 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Preferably without multi-cursor plugin - 326 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 33
  • Number of attempts: 6
quotes inside quotes - 2834 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: 17
  • Number of attempts: 2
comment and uncomment code inline - 862 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: 13
  • Number of attempts: 3
replacing each line of a block selection - 2591 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 22
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 9728 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 5
Swap values inside brackets - 1757 entries

Easy challenge.

  • Best score: 13
  • Best player score: 23
  • Number of attempts: 1
Just the middle - 9685 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 3
Words in parens - 11374 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 7
Add semicolons - 4344 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 3
remove lines containing the word "reader" - 2177 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Number of attempts: 2
Simple, Practical, and Common - 26822 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
  • Number of attempts: 5
ASCII Art - 76 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
From argument to object - 1132 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: 18
  • Number of attempts: 4
Delete unwanted lines - 339 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Applying same text modification in several lines - 1994 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
-a-b-c- - 2689 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 5
Swap values - 3763 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 3
Every other line - 2232 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Number of attempts: 1
One number per line - 14188 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 8
Not real
Twitter:

entered into 29 challenges

contributed 0 challenges