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 - 32953 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 / 7275
  • Number of attempts: 8
Swap values - 4440 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #368 / 1241
  • Number of attempts: 3
V to the i - 4641 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #791 / 1857
  • Number of attempts: 2
Add semicolons - 10545 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #801 / 2989
  • Number of attempts: 3
Com(m)a Trouble - 3410 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #234 / 764
  • Number of attempts: 2
Box it - 7682 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #841 / 1836
  • Number of attempts: 3
Just the middle - 11141 entries

Delete the instructions at the top and bottom.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 24
  • Position: #1057 / 1228
  • Number of attempts: 1
Vice versa - 7535 entries

Little role switching.

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

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

  • Best score: 16
  • Best player score: 21
  • Position: #43 / 80
  • Number of attempts: 4
Reorder the groups - 1112 entries

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

  • Best score: 14
  • Best player score: 14
  • Position: #17 / 252
  • Number of attempts: 2
Swap assigned value - 561 entries

Simple problem but looking for interesting solutions.

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

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

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

Oops.

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

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1827 / 3638
  • Number of attempts: 2
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1849 / 3919
  • Number of attempts: 3
Draw the Go board - 138 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: #28 / 47
  • Number of attempts: 3
Word frequency alignment - 245 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 / 146
  • Number of attempts: 1
Minimalist Limerick - 507 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 35
  • Position: #69 / 168
  • Number of attempts: 1
Define to require - 118 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: #12 / 48
  • Number of attempts: 2
Groups magic - 142 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: #73 / 85
  • Number of attempts: 1
Prefixes and suffixes - 567 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #99 / 185
  • Number of attempts: 1
Saving the hashes(#) - 1966 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: #413 / 467
  • Number of attempts: 1

Contributed Challenges

Chinese Multiplication Table - 70 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