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 - 33385 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 / 7364
  • Number of attempts: 8
Swap values - 4543 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #374 / 1257
  • Number of attempts: 3
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #804 / 1879
  • Number of attempts: 2
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #825 / 3044
  • Number of attempts: 3
Com(m)a Trouble - 3675 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #251 / 827
  • Number of attempts: 2
Box it - 7828 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #859 / 1865
  • Number of attempts: 3
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 24
  • Position: #1084 / 1258
  • Number of attempts: 1
Vice versa - 7805 entries

Little role switching.

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

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

  • Best score: 16
  • Best player score: 21
  • Position: #48 / 87
  • Number of attempts: 4
Reorder the groups - 1137 entries

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

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

Simple problem but looking for interesting solutions.

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

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

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

Oops.

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

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1847 / 3667
  • Number of attempts: 2
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1868 / 3946
  • Number of attempts: 3
Draw the Go board - 140 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 / 48
  • Number of attempts: 3
Word frequency alignment - 274 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 / 157
  • Number of attempts: 1
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 35
  • Position: #69 / 171
  • 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 - 153 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: #77 / 91
  • Number of attempts: 1
Prefixes and suffixes - 593 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #102 / 193
  • Number of attempts: 1
Saving the hashes(#) - 1992 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: #416 / 473
  • Number of attempts: 1

Contributed Challenges

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