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 - 33385 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 / 7364
  • Number of attempts: 5
Swap values - 4543 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Position: #914 / 1257
  • Number of attempts: 3
One number per line - 18616 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #1818 / 3842
  • Number of attempts: 8
Swap values inside brackets - 2464 entries

Easy challenge.

  • Best score: 14
  • Best player score: 23
  • Position: #466 / 569
  • Number of attempts: 1
V to the i - 4751 entries

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

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

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

  • Best score: 12
  • Best player score: 14
  • Position: #389 / 840
  • Number of attempts: 2
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #909 / 3044
  • Number of attempts: 3
Bad Copy Syntax - 2001 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #376 / 516
  • Number of attempts: 1
remove lines containing the word "reader" - 3537 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Position: #1019 / 1144
  • Number of attempts: 2
Box it - 7828 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #868 / 1865
  • Number of attempts: 2
From argument to object - 1474 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: #234 / 450
  • Number of attempts: 4
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #499 / 700
  • Number of attempts: 1
Preferably without multi-cursor plugin - 538 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: #48 / 127
  • Number of attempts: 6
comment and uncomment code inline - 1069 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: #275 / 314
  • Number of attempts: 3
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2715 / 4164
  • Number of attempts: 3
ASCII Art - 82 entries

how good are you with simple regex?

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

change the pair of braces into a pair of parentheses

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

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 25
  • Position: #390 / 440
  • Number of attempts: 1
Subtraction - 178 entries

Solve the equations.

  • Best score: 18
  • Best player score: 26
  • Position: #39 / 61
  • Number of attempts: 1
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #680 / 1129
  • Number of attempts: 5
Change name of a variable - 169 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 / 132
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10628 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2327 / 3667
  • Number of attempts: 5
quotes inside quotes - 3125 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: #913 / 1072
  • Number of attempts: 2
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1676 / 3946
  • Number of attempts: 7
Delete unwanted lines - 396 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #169 / 225
  • Number of attempts: 2
Saving the hashes(#) - 1992 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: #297 / 473
  • Number of attempts: 2
replacing each line of a block selection - 2947 entries

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

  • Best score: 18
  • Best player score: 22
  • Position: #429 / 768
  • Number of attempts: 2
switch variable - 5036 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #939 / 1736
  • Number of attempts: 9
Whitespace, empty lines and tabs - 3339 entries

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

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

entered into 29 challenges

contributed 0 challenges