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 - 33609 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 / 7415
  • 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 - 18712 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Position: #968 / 3859
  • Number of attempts: 8
V to the i - 4799 entries

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

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

Simply add a semicolon at the end of each line

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

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

  • Best score: 18
  • Best player score: 22
  • Position: #313 / 524
  • Number of attempts: 1
Box it - 7902 entries

Create a box around a line.

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

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

  • Best score: 13
  • Best player score: 13
  • Position: #235 / 752
  • 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 - 11446 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1272 / 4194
  • 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 - 1092 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 / 245
  • 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 - 2020 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 / 584
  • Number of attempts: 7
A HAPPY NEW YEAR 2014 ! - 10658 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #925 / 3680
  • 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 - 1054 entries

Some lines need the semicolon, some don't.

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

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

  • Best score: 13
  • Best player score: 14
  • Position: #1780 / 3681
  • 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