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

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #75 / 3842
  • Number of attempts: 6
Split line with dots - 2125 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 15
  • Position: #77 / 630
  • Number of attempts: 5
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #85 / 700
  • Number of attempts: 3
Start coding format - 147 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 24
  • Position: #42 / 70
  • Number of attempts: 1
Search and Replace 0 - 4792 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Position: #459 / 1585
  • Number of attempts: 6
comment and uncomment code inline - 1069 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 9
  • Position: #15 / 314
  • Number of attempts: 2
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #689 / 4164
  • Number of attempts: 2
Stairstep digits - 376 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 9
  • Position: #10 / 141
  • Number of attempts: 2
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 63 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

  • Best score: 18
  • Best player score: 18
  • Position: #6 / 37
  • Number of attempts: 1
Basic renumbering - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #35 / 1258
  • Number of attempts: 6
Simple addition - 310 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 12
  • Position: #10 / 117
  • Number of attempts: 3
Nesting SASS - 261 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 9
  • Position: #10 / 93
  • Number of attempts: 3
underscore_to_camelCase - 162 entries

Pointy haired boss decided we need to switch to camelCase. Let's get this over with.

  • Best score: 14
  • Best player score: 14
  • Position: #26 / 80
  • Number of attempts: 3
Vice versa - 7805 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #203 / 2101
  • Number of attempts: 3
Double and switch - 37 entries

Aaaanother case switcher

  • Best score: 18
  • Best player score: 18
  • Position: #3 / 17
  • Number of attempts: 2
Pretty multi-line bash - 218 entries

Bash line continuations are much prettier when they're column aligned.

  • Best score: 15
  • Best player score: 15
  • Position: #11 / 75
  • Number of attempts: 4
7th Birthday - 186 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 19
  • Position: #2 / 73
  • Number of attempts: 3
Free hyphen! - 159 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 11
  • Position: #68 / 85
  • Number of attempts: 1
Paragraph sort - 430 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 19
  • Position: #97 / 123
  • Number of attempts: 1
SQL to YAML - 45 entries

Should be easy with vim, or not?

  • Best score: 72
  • Best player score: 72
  • Position: #2 / 20
  • Number of attempts: 3
Order and join - 956 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #83 / 255
  • Number of attempts: 2
Paragraph breaks - 505 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 13
  • Position: #99 / 165
  • Number of attempts: 2
lipsum lines - 252 entries

Convert a quoted block of text into strings in a list.

  • Best score: 28
  • Best player score: 28
  • Position: #13 / 91
  • Number of attempts: 7
Inner hyphens - 124 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

  • Best score: 11
  • Best player score: 12
  • Position: #58 / 77
  • Number of attempts: 1
Change attribute to getter - 133 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 24
  • Position: #4 / 57
  • Number of attempts: 2
ascii-art diamond - 35 entries

Simple ascii-art diamond. The grid is 40x40.

  • Best score: 40
  • Best player score: 40
  • Position: #1 / 15
  • Number of attempts: 3
A grid of punctuation - 124 entries

Create a checkerboard of = and - in an 80×24 grid!

  • Best score: 16
  • Best player score: 16
  • Position: #15 / 57
  • Number of attempts: 1
Generate a list of numbers - 283 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 14
  • Position: #24 / 136
  • Number of attempts: 1
ASCII Art - 82 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Position: #22 / 52
  • Number of attempts: 2
No naked if allowed! - 25 entries

House style forbids naked condition statements, comments should start with a space character and be on their own line. Good luck!

  • Best score: 46
  • Best player score: 57
  • Position: #7 / 14
  • Number of attempts: 1
From A to B - 564 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 16
  • Position: #25 / 155
  • Number of attempts: 3
swap or reverse - 115 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Position: #42 / 66
  • Number of attempts: 1
Conway sequence - 23 entries

Generate the the first fifteen numbers. See here for more information: http://en.wikipedia.org/wiki/Look-and-say_sequence

  • Best score: 43
  • Best player score: 43
  • Position: #10 / 18
  • Number of attempts: 1
Happy TvvO - 411 entries

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

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

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #436 / 4161
  • Number of attempts: 3
Count both ways - 1001 entries

Right AND down.

  • Best score: 13
  • Best player score: 17
  • Position: #311 / 351
  • Number of attempts: 1
Gray area - 732 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 11
  • Position: #18 / 268
  • Number of attempts: 4
Neither Fizz nor Buzz - 226 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #75 / 99
  • Number of attempts: 1
Don't know what this is - 1978 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 12
  • Position: #198 / 578
  • Number of attempts: 5
A HAPPY NEW YEAR 2014 ! - 10628 entries

A HAPPY NEW YEAR 2014 !

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

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1547 / 3946
  • Number of attempts: 2
Enumerate words - 250 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 23
  • Position: #3 / 89
  • Number of attempts: 3
A Simple One - 1001 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #438 / 643
  • Number of attempts: 1
The Cake is a Lie - 1286 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #224 / 512
  • Number of attempts: 1
Remove Accent off the Letter - 106 entries

Remove all the accent from extremely accented statements.

  • Best score: 37
  • Best player score: 37
  • Position: #1 / 49
  • Number of attempts: 8
Stanislav
Twitter:

entered into 46 challenges

contributed 0 challenges