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 - 33612 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: #375 / 7416
  • Number of attempts: 8
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #376 / 1268
  • Number of attempts: 3
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #809 / 1893
  • Number of attempts: 2
Add semicolons - 10850 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #828 / 3062
  • Number of attempts: 3
Com(m)a Trouble - 3815 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 13
  • Position: #258 / 864
  • Number of attempts: 2
Box it - 7904 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #862 / 1875
  • Number of attempts: 3
Just the middle - 11446 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #76 / 4194
  • Number of attempts: 3
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 24
  • Position: #1091 / 1264
  • Number of attempts: 1
Vice versa - 7903 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #156 / 2125
  • Number of attempts: 3
Remove quotes after first field - 380 entries

Remove the quotes around each field except for the first field.

  • Best score: 16
  • Best player score: 21
  • Position: #51 / 91
  • Number of attempts: 4
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: #17 / 264
  • Number of attempts: 2
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #26 / 254
  • Number of attempts: 2
Happy TvvO - 426 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #39 / 205
  • Number of attempts: 1
I forgot quotes - 15977 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #60 / 4177
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10660 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1853 / 3681
  • Number of attempts: 2
Words in parens - 12929 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1878 / 3961
  • Number of attempts: 3
Draw the Go board - 149 entries

which is a 19×19 lines board. Here we use ascii characters only for simplicity. See diff file to get a sense. (See also http://en.wikipedia.org/wiki/Go_(game))

  • Best score: 50
  • Best player score: 72
  • Position: #30 / 51
  • Number of attempts: 3
Word frequency alignment - 290 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: #30 / 161
  • Number of attempts: 1
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 35
  • Position: #70 / 174
  • Number of attempts: 1
Define to require - 127 entries

When JSHint is enabled, there's a rule that doesn't let you have more than 6 arguments in a function, so the moment you need to add a 7th argument, you need to do a refactoring.

  • Best score: 62
  • Best player score: 67
  • Position: #13 / 50
  • Number of attempts: 2
Groups magic - 158 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 15
  • Position: #78 / 93
  • Number of attempts: 1
Prefixes and suffixes - 629 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 27
  • Position: #104 / 196
  • Number of attempts: 1
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: 33
  • Position: #423 / 480
  • Number of attempts: 1

Contributed Challenges

Chinese Multiplication Table - 81 entries

Print a Chinese multiplication table in Vim. In China, every kid is asked to memorize this table. And thanks to the mono-syllabism of Chinese characters, it is not that hard. Printing the multiplication table is also a good exercise for programming beginners. For-loop, escaped characters, etc... There should be some special ways to print it in Vim.

zealotrush
Twitter:

entered into 23 challenges

contributed 1 challenges