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

Going underground.... - 291 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 27
  • Number of attempts: 5
Array propagate - 241 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 24
  • Number of attempts: 4
Simple, Practical, and Common - 26149 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: 14
  • Best player score: 22
  • Number of attempts: 6
Change the content of a string - 1245 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Number of attempts: 5
multiple cursor alternative - 1143 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 20
  • Number of attempts: 6
Scrambled numbers - 743 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 7
NATO phonetic alphabet - 407 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 6
Assignment Alignment - 700 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 10
From argument to object - 1121 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 2
Mess in revision history - 995 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 7
remove dupes from array - 1205 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 10
Team names - 1498 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 4
One number per line - 13706 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 8
Reconstruct the Sentence - 1028 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 20
  • Best player score: 20
  • Number of attempts: 5
Hole-in-one - 941 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 7
lamb had a little Mary - 491 entries

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

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 8
Make Fancy Header - 919 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 4
imports alignment (python) - 577 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 9
Interactive git rebase changing commands - 151 entries

How to change the action of some commits in git rebase dialog.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 2
Switch function arguments - 1843 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 5
readability - 285 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 2
Search and Replace 0 - 4187 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
The name of the game - 586 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Append semicolon after expressions - 875 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Split line with dots - 1894 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 19
  • Number of attempts: 3
Where should I put the Newline? - 798 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
switch variable - 4382 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
Array transposition - 1704 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 10
Shebangs for all - 1618 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 7
Logging with key - 275 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 6
That hyphen - 2220 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 4
comments galore - 910 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Swap assigned value - 499 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 3
Swap values - 3672 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 5
Wrap the text of an email message to 79 characters - 495 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 2
Collect List - 3575 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 6
I forgot quotes - 12364 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 7
Let's play some Ivmgolf - 926 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Remove semicolons after expressions - 463 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 2
Hello ${world} - 232 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

  • Best score: 24
  • Best player score: 24
  • Number of attempts: 5
Missing Library and a Typo - 722 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 3
The meaning - 502 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Just the middle - 9525 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
A simple change - 362 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 3
Saving the hashes(#) - 1770 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: 21
  • Number of attempts: 6
Don't know what this is - 1787 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: 11
  • Number of attempts: 6
Extract argument from function - 2037 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 5
Order and join - 756 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 5
Letter case trickery - 1450 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: 9
  • Number of attempts: 5
comment and uncomment code inline - 843 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
  • Number of attempts: 3
Wrap text in quotes - 297 entries

All the blocks of text should be wrapped in quotation marks.

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 4
Stairs Indenting - 360 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 5
Condensed Cases - 695 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: 12
  • Number of attempts: 6
Basic renumbering - 4756 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 20
  • Number of attempts: 4
Gray area - 650 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 4
Happy TvvO - 354 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Remove noise from HTTP log - 618 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 2
Shuffle puzzle - 289 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: 13
  • Number of attempts: 6
Fiddle percentages into real numbers - 724 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 4
Add to end of each line... kinda - 264 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Simple text editing with Vim - 10592 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Replacing some words - 400 entries

How fast could it be?

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 8
Numbering a List - 1746 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 9
SFD-ROC: vimvimvim - 1305 entries

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

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 6
Make it more readable - 1765 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
Vice versa - 6132 entries

Little role switching.

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 3
Lisp Condense - 387 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Interweave two blocks of text - 498 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 5
Copy three lines - 2208 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 10
Every other line - 2197 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 6
Ruby 1.9 compat - 557 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 6
Words in parens - 11260 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 4
Reverse and double space - 411 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 9653 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
The Cake is a Lie - 1136 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Reverse characters in a line - 585 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 6
Space out the alphabet - 1401 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 9
BarbaJol
Twitter:

A ja, ha, čujte....

entered into 77 challenges

contributed 0 challenges