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

Preferably without multi-cursor plugin - 277 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
Whitespace, empty lines and tabs - 2541 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(#) - 1732 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
Space out the alphabet - 1358 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 25
  • Number of attempts: 1
One number per line - 12472 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 3
Every other line - 2076 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Number of attempts: 1
Swap values - 3483 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 3
From argument to object - 1073 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 - 336 entries

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

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
ASCII Art - 75 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
-a-b-c- - 2551 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 5
A HAPPY NEW YEAR 2014 ! - 9440 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 5
Subtraction - 147 entries

Solve the equations.

  • Best score: 18
  • Best player score: 26
  • Number of attempts: 1
replacing each line of a block selection - 2498 entries

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

  • Best score: 18
  • Best player score: 22
  • Number of attempts: 2
quotes inside quotes - 2757 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
Change name of a variable - 145 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
Just the middle - 9090 entries

Delete the instructions at the top and bottom.

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

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 7
V to the i - 3874 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 8
switch variable - 4286 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 9
Simple, Practical, and Common - 24508 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
comment and uncomment code inline - 790 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
Not real
Twitter:

entered into 22 challenges

contributed 0 challenges