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 - 33988 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: 24
  • Position: #2945 / 7509
  • Number of attempts: 1
Wget failed to download redirections - 232 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 20
  • Position: #42 / 71
  • Number of attempts: 2
Search and Replace 0 - 5124 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #1228 / 1670
  • Number of attempts: 1
Just the middle - 11613 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1740 / 4253
  • Number of attempts: 1
Basic renumbering - 5731 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 18
  • Position: #646 / 1277
  • Number of attempts: 1
Swap assigned value - 681 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #74 / 262
  • Number of attempts: 2
VimGolfNight - 583 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #210 / 354
  • Number of attempts: 1
Interleave lines - 209 entries

This is some kind of « paste -d'\n' c b a ». There are many ways to achieve this.. just find the shortest!

  • Best score: 17
  • Best player score: 28
  • Position: #32 / 62
  • Number of attempts: 1
Logging with key - 342 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 26
  • Position: #47 / 89
  • Number of attempts: 1
Fix the XML - 1050 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 24
  • Position: #117 / 291
  • Number of attempts: 1
Condensed Cases - 821 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 14
  • Position: #138 / 252
  • Number of attempts: 1
-a-b-c- - 3237 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #792 / 1145
  • Number of attempts: 1
Count both ways - 1037 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #216 / 359
  • Number of attempts: 1
Lisp Condense - 473 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 15
  • Position: #98 / 160
  • Number of attempts: 1
Don't know what this is - 2048 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: 15
  • Position: #404 / 592
  • Number of attempts: 1
Where should I put the Newline? - 898 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #347 / 446
  • Number of attempts: 1
Shuffle puzzle - 361 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 15
  • Position: #65 / 106
  • Number of attempts: 1
Letter case trickery - 1664 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 12
  • Position: #343 / 523
  • Number of attempts: 1
quotes inside quotes - 3200 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 16
  • Position: #613 / 1091
  • Number of attempts: 1
Words in parens - 13034 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2223 / 3988
  • Number of attempts: 1
Pairs of numbers - 387 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 31
  • Position: #49 / 138
  • Number of attempts: 1
NATO phonetic alphabet - 547 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 22
  • Position: #121 / 199
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1641 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #220 / 456
  • Number of attempts: 1
Vertical Limit - 2634 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 26
  • Position: #481 / 776
  • Number of attempts: 1
replacing each line of a block selection - 3050 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 29
  • Position: #639 / 787
  • Number of attempts: 1
Switch function arguments - 2204 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #412 / 681
  • Number of attempts: 1
Append semicolon after expressions - 1071 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #342 / 425
  • Number of attempts: 1
switch variable - 5120 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1173 / 1761
  • Number of attempts: 1
The meaning - 581 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #247 / 366
  • Number of attempts: 1
Make it more readable - 2036 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #404 / 657
  • Number of attempts: 1
PHP Array Syntax -> MailChimp Merge Syntax - 569 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 33
  • Position: #89 / 152
  • Number of attempts: 1
Numbering a List - 1944 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #342 / 659
  • Number of attempts: 1
Reverse Simple Deletion - 870 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Position: #27 / 465
  • Number of attempts: 2
Reverse characters in a line - 832 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 8
  • Best player score: 14
  • Position: #111 / 278
  • Number of attempts: 1
Change the content of a string - 1779 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #152 / 651
  • Number of attempts: 1
Simple text editing with Vim - 13576 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #1455 / 3892
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 7649 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 7
  • Best player score: 35
  • Position: #396 / 1882
  • Number of attempts: 1
TheProgrammer971
Twitter:

Ich kann Programmieren, bin ein Youtuber und ich mag Mathe!

entered into 37 challenges

contributed 0 challenges