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 - 32690 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: 9
Swap values - 4374 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 7
One number per line - 18195 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 8
V to the i - 4595 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Add semicolons - 10409 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 2
Bad Copy Syntax - 1881 entries

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

  • Best score: 18
  • Best player score: 22
  • Number of attempts: 1
Box it - 7605 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Number of attempts: 5
Extract argument from function - 2176 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 4
Preferably without multi-cursor plugin - 453 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: 42
  • Number of attempts: 2
That hyphen - 2457 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 5
Just the middle - 11073 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Fun With The Diagonal - 96 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
Mirrored text - 160 entries

backward and forward, and long enough to be challenging

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 2
Inner hyphens - 118 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Align commas - 1000 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 12
ASCII Art - 80 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Reorder the groups - 1066 entries

Change the order so that the groups of fruit come before the vegetables.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 10
Don't know what this is - 1905 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 3
  • Best player score: 11
  • Number of attempts: 7
A HAPPY NEW YEAR 2014 ! - 10509 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
Saving the hashes(#) - 1921 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: 20
  • Number of attempts: 14
Append semicolon after expressions - 899 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 7
Simple text editing with Vim - 11334 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 4

Contributed Challenges

ASCII Art - 80 entries

how good are you with simple regex?

Fun With The Diagonal - 96 entries

change the lowercase characters on the main diagonal to uppercase

Wistan Chou
Twitter:

entered into 22 challenges

contributed 2 challenges