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

Just give me the numbers.

  • Best score: 14
  • Best player score: 23
  • Position: #2912 / 3842
  • Number of attempts: 1
vim = 22 / 7 - 447 entries

pi square vim

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

Delete the instructions at the top and bottom.

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

The team names are misspelled.

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

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #139 / 249
  • Number of attempts: 2
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 20
  • Position: #3272 / 3946
  • Number of attempts: 2
Parsing with CSV: Unify lines and result. - 165 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: #36 / 73
  • Number of attempts: 5
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: #59 / 157
  • Number of attempts: 1
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 31
  • Position: #8 / 171
  • Number of attempts: 7
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: 62
  • Position: #4 / 48
  • Number of attempts: 8
fib.c cleanup - 66 entries

cleanup the file

  • Best score: 15
  • Best player score: 17
  • Position: #49 / 54
  • Number of attempts: 2
Transposition - 82 entries

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

  • Best score: 31
  • Best player score: 39
  • Position: #11 / 30
  • Number of attempts: 3
Groups magic - 150 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 / 90
  • Number of attempts: 4
Prefixes and suffixes - 591 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #104 / 192
  • Number of attempts: 4
Refactor arguments into object argument - 161 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 58
  • Position: #19 / 65
  • Number of attempts: 3
Sort by your own sum - 71 entries

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

  • Best score: 25
  • Best player score: 33
  • Position: #15 / 28
  • Number of attempts: 4
Python: Lots of function arguments - 102 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #8 / 46
  • Number of attempts: 2
Readable Rubyhash - 244 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: #67 / 92
  • Number of attempts: 1
Dehamlizing - 180 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 37
  • Position: #19 / 69
  • Number of attempts: 7
A simple change - 442 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #11 / 189
  • Number of attempts: 4
Add links to an existing HTML table - 77 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: #16 / 29
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 169 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: #48 / 101
  • Number of attempts: 2
The Quick Brown Fox Jumps Over The Lazy Vim - 401 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: #108 / 188
  • Number of attempts: 2
The name of the game - 650 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 13
  • Position: #325 / 356
  • Number of attempts: 1
SFD-ROC: ASCII Logo Border - 71 entries

Draw a border around this familiar logo ;)

  • Best score: 20
  • Best player score: 42
  • Position: #29 / 31
  • Number of attempts: 3
lamb had a little Mary - 586 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #5 / 163
  • Number of attempts: 7
SFD-ROC: vimvimvim - 1581 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: #389 / 439
  • Number of attempts: 2
Stairs Indenting - 448 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 19
  • Position: #164 / 193
  • Number of attempts: 3
Unwrap the text of an email message - 185 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: #60 / 72
  • Number of attempts: 1
Python to Ruby - 196 entries

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

  • Best score: 24
  • Best player score: 38
  • Position: #41 / 59
  • Number of attempts: 5
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: 25
  • Position: #142 / 473
  • Number of attempts: 5
SFD-ROC: ROT13 Phonics - 98 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 / 71
  • Number of attempts: 1
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #25 / 441
  • Number of attempts: 4
you're stuck on jQuery < 1.7 - 337 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 / 111
  • Number of attempts: 8
Make the circuit grid! - 87 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 / 48
  • 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