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 - 33616 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: #377 / 7420
  • Number of attempts: 9
Swap values - 4616 entries

Well, swap the values...

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

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Position: #969 / 3864
  • Number of attempts: 8
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #669 / 1893
  • Number of attempts: 2
Add semicolons - 10852 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #958 / 3063
  • Number of attempts: 2
Bad Copy Syntax - 2037 entries

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

  • Best score: 18
  • Best player score: 22
  • Position: #314 / 525
  • Number of attempts: 1
Box it - 7905 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #668 / 1876
  • Number of attempts: 5
Extract argument from function - 2357 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #235 / 753
  • Number of attempts: 4
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: 42
  • Position: #113 / 129
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Position: #266 / 701
  • Number of attempts: 5
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1272 / 4197
  • Number of attempts: 2
Fun With The Diagonal - 107 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #13 / 81
  • Number of attempts: 2
Mirrored text - 177 entries

backward and forward, and long enough to be challenging

  • Best score: 14
  • Best player score: 14
  • Position: #3 / 71
  • Number of attempts: 2
Inner hyphens - 136 entries

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

  • Best score: 11
  • Best player score: 12
  • Position: #28 / 82
  • Number of attempts: 1
Align commas - 1095 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
  • Position: #82 / 246
  • Number of attempts: 12
ASCII Art - 87 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Position: #1 / 54
  • Number of attempts: 2
Reorder the groups - 1181 entries

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

  • Best score: 14
  • Best player score: 14
  • Position: #41 / 264
  • Number of attempts: 10
Don't know what this is - 2022 entries

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

  • Best score: 11
  • Best player score: 11
  • Position: #118 / 585
  • Number of attempts: 7
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #925 / 3683
  • 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: 20
  • Position: #61 / 480
  • Number of attempts: 14
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #120 / 419
  • Number of attempts: 7
Simple text editing with Vim - 12811 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1785 / 3694
  • Number of attempts: 4

Contributed Challenges

ASCII Art - 87 entries

how good are you with simple regex?

Fun With The Diagonal - 107 entries

change the lowercase characters on the main diagonal to uppercase

Wistan Chou
Twitter:

entered into 22 challenges

contributed 2 challenges