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

Simple, Practical, and Common - 33621 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: #1465 / 7422
  • Number of attempts: 5
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Position: #921 / 1268
  • Number of attempts: 3
One number per line - 18732 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #1826 / 3865
  • Number of attempts: 8
Swap values inside brackets - 2496 entries

Easy challenge.

  • Best score: 14
  • Best player score: 23
  • Position: #474 / 579
  • Number of attempts: 1
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #590 / 1893
  • Number of attempts: 11
Applying same text modification in several lines - 2880 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #395 / 851
  • Number of attempts: 2
Add semicolons - 10859 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #913 / 3064
  • Number of attempts: 3
Bad Copy Syntax - 2037 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #383 / 525
  • Number of attempts: 1
remove lines containing the word "reader" - 3586 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Position: #1035 / 1162
  • Number of attempts: 2
Box it - 7905 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #871 / 1876
  • Number of attempts: 2
From argument to object - 1508 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
  • Position: #237 / 458
  • Number of attempts: 4
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #501 / 703
  • Number of attempts: 1
Preferably without multi-cursor plugin - 540 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
  • Position: #49 / 129
  • Number of attempts: 6
comment and uncomment code inline - 1122 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
  • Position: #282 / 322
  • Number of attempts: 3
Just the middle - 11457 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2719 / 4198
  • Number of attempts: 3
ASCII Art - 87 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Position: #25 / 54
  • Number of attempts: 2
change parenthesis - 296 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 9
  • Position: #23 / 161
  • Number of attempts: 3
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 25
  • Position: #393 / 444
  • Number of attempts: 1
Subtraction - 180 entries

Solve the equations.

  • Best score: 18
  • Best player score: 26
  • Position: #40 / 62
  • Number of attempts: 1
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #684 / 1137
  • Number of attempts: 5
Change name of a variable - 179 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
  • Position: #108 / 137
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10666 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2335 / 3684
  • Number of attempts: 5
quotes inside quotes - 3159 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
  • Position: #915 / 1078
  • Number of attempts: 2
Words in parens - 12939 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1685 / 3964
  • Number of attempts: 7
Delete unwanted lines - 413 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #169 / 229
  • Number of attempts: 2
Saving the hashes(#) - 2063 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
  • Position: #302 / 480
  • Number of attempts: 2
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 22
  • Position: #435 / 777
  • Number of attempts: 2
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #943 / 1748
  • Number of attempts: 9
Whitespace, empty lines and tabs - 3670 entries

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

  • Best score: 16
  • Best player score: 29
  • Position: #514 / 788
  • Number of attempts: 2
Not real
Twitter:

entered into 29 challenges

contributed 0 challenges