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 - 33483 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: #1145 / 7384
  • Number of attempts: 10
One number per line - 18673 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 23
  • Position: #2920 / 3852
  • Number of attempts: 1
vim = 22 / 7 - 451 entries

pi square vim

  • Best score: 20
  • Best player score: 20
  • Position: #11 / 133
  • Number of attempts: 7
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1013 / 4174
  • Number of attempts: 5
Team names - 1812 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #21 / 585
  • Number of attempts: 9
Swap assigned value - 628 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #141 / 252
  • Number of attempts: 2
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 20
  • Position: #3274 / 3950
  • Number of attempts: 2
Parsing with CSV: Unify lines and result. - 167 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

  • Best score: 21
  • Best player score: 22
  • Position: #37 / 75
  • Number of attempts: 5
Word frequency alignment - 278 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: #59 / 159
  • Number of attempts: 1
Minimalist Limerick - 519 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 31
  • Position: #9 / 173
  • Number of attempts: 7
Define to require - 119 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: 62
  • Position: #4 / 49
  • Number of attempts: 8
fib.c cleanup - 67 entries

cleanup the file

  • Best score: 15
  • Best player score: 17
  • Position: #50 / 55
  • Number of attempts: 2
Transposition - 83 entries

Transpose the original lines in separate columns, one for each line.

  • Best score: 31
  • Best player score: 39
  • Position: #12 / 31
  • Number of attempts: 3
Groups magic - 157 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: 13
  • Position: #8 / 92
  • Number of attempts: 4
Prefixes and suffixes - 599 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #105 / 195
  • Number of attempts: 4
Refactor arguments into object argument - 162 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 58
  • Position: #20 / 66
  • Number of attempts: 3
Sort by your own sum - 74 entries

Same numbers as last time, but you'll have to add them yourself.

  • Best score: 25
  • Best player score: 33
  • Position: #16 / 29
  • Number of attempts: 4
Python: Lots of function arguments - 105 entries

The function definition is too long for one line. The modeline helps you with some typical Python indent settings.

  • Best score: 6
  • Best player score: 13
  • Position: #10 / 48
  • Number of attempts: 2
Readable Rubyhash - 245 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 23
  • Best player score: 30
  • Position: #68 / 93
  • Number of attempts: 1
Dehamlizing - 184 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 37
  • Position: #20 / 71
  • Number of attempts: 7
A simple change - 444 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 12
  • Position: #11 / 190
  • Number of attempts: 4
Add links to an existing HTML table - 78 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

  • Best score: 42
  • Best player score: 55
  • Position: #17 / 30
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 175 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 24
  • Best player score: 28
  • Position: #50 / 104
  • Number of attempts: 2
The Quick Brown Fox Jumps Over The Lazy Vim - 404 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 11
  • Position: #109 / 190
  • Number of attempts: 2
The name of the game - 654 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 13
  • Position: #327 / 359
  • Number of attempts: 1
SFD-ROC: ASCII Logo Border - 72 entries

Draw a border around this familiar logo ;)

  • Best score: 20
  • Best player score: 42
  • Position: #30 / 32
  • Number of attempts: 3
lamb had a little Mary - 596 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 16
  • Position: #5 / 164
  • Number of attempts: 7
SFD-ROC: vimvimvim - 1594 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 15
  • Position: #392 / 443
  • Number of attempts: 2
Stairs Indenting - 452 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 19
  • Position: #165 / 195
  • Number of attempts: 3
Unwrap the text of an email message - 188 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 26
  • Position: #61 / 73
  • Number of attempts: 1
Python to Ruby - 198 entries

Convert this Python code to Ruby. NOTE: This program likely won't run.

  • Best score: 24
  • Best player score: 38
  • Position: #42 / 60
  • Number of attempts: 5
Saving the hashes(#) - 2008 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: 25
  • Position: #143 / 476
  • Number of attempts: 5
SFD-ROC: ROT13 Phonics - 99 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

  • Best score: 6
  • Best player score: 6
  • Position: #31 / 72
  • Number of attempts: 1
Let's play some Ivmgolf - 1096 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #25 / 442
  • Number of attempts: 4
you're stuck on jQuery < 1.7 - 338 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

  • Best score: 25
  • Best player score: 25
  • Position: #6 / 112
  • Number of attempts: 8
Make the circuit grid! - 91 entries

Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.

  • Best score: 26
  • Best player score: 26
  • Position: #17 / 49
  • Number of attempts: 4
Chasetopher
Twitter:

I speedrun Zelda games, mostly The Wind Waker. https://t.co/ywgxFXOmi9

entered into 36 challenges

contributed 0 challenges