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 - 33930 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: 27
  • Position: #3885 / 7490
  • Number of attempts: 2
One number per line - 18840 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #1722 / 3893
  • Number of attempts: 2
Swap values inside brackets - 2539 entries

Easy challenge.

  • Best score: 13
  • Best player score: 22
  • Position: #453 / 590
  • Number of attempts: 3
Applying same text modification in several lines - 2920 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #284 / 864
  • Number of attempts: 4
Every other line - 2925 entries

AaAaAaA

  • Best score: 12
  • Best player score: 18
  • Position: #568 / 707
  • Number of attempts: 2
Preferably without multi-cursor plugin - 557 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: 38
  • Position: #93 / 133
  • Number of attempts: 1
That hyphen - 2602 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #468 / 704
  • Number of attempts: 3
comment and uncomment code inline - 1151 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: 12
  • Position: #241 / 328
  • Number of attempts: 3
Just the middle - 11555 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2429 / 4234
  • Number of attempts: 1
Simple addition - 334 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 16
  • Position: #114 / 125
  • Number of attempts: 1
Adam's challenge - 1010 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: 24
  • Position: #232 / 277
  • Number of attempts: 1
Fiddle percentages into real numbers - 880 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 18
  • Position: #237 / 295
  • Number of attempts: 3
Nesting SASS - 287 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 17
  • Position: #72 / 99
  • Number of attempts: 4
Combines all items - 313 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 11
  • Position: #135 / 140
  • Number of attempts: 1
replace 2nd column blanks with values in same column if blank - 242 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

  • Best score: 15
  • Best player score: 20
  • Position: #74 / 83
  • Number of attempts: 1
Vice versa - 7981 entries

Little role switching.

  • Best score: 12
  • Best player score: 16
  • Position: #1299 / 2147
  • Number of attempts: 1
Space out the alphabet - 1659 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 22
  • Position: #331 / 446
  • Number of attempts: 1
I forgot quotes - 16127 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2587 / 4208
  • Number of attempts: 4
-a-b-c- - 3225 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #659 / 1140
  • Number of attempts: 2
Change name of a variable - 180 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: #101 / 138
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10721 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2202 / 3704
  • Number of attempts: 2
Words in parens - 13005 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2380 / 3979
  • Number of attempts: 1
Word frequency alignment - 296 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 5
  • Position: #97 / 163
  • Number of attempts: 1
replacing each line of a block selection - 3028 entries

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

  • Best score: 18
  • Best player score: 23
  • Position: #482 / 784
  • Number of attempts: 1
Switch function arguments - 2192 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #511 / 677
  • Number of attempts: 1
switch variable - 5101 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #925 / 1756
  • Number of attempts: 3
Edouard Piette
Twitter:

Photography 📷 Brewing 🍺 https://t.co/PUCX8jX19C

entered into 26 challenges

contributed 0 challenges