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

Words in parens - 12294 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 5
Change part of a function name in multiple occurrences - 566 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 6
Box it - 6849 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 27
  • Number of attempts: 2
One number per line - 17290 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 3
Yo To Hello - 633 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Add string initializers to an enum - 668 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 22
  • Number of attempts: 2
camel riding - 731 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 4
switch variable - 4742 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Saving the hashes(#) - 1876 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
  • Number of attempts: 5
Simple, Practical, and Common - 31350 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: 25
  • Number of attempts: 10
Remove quotes after first field - 225 entries

Remove the quotes around each field except for the first field.

  • Best score: 16
  • Best player score: 21
  • Number of attempts: 4
citizen_hacks_2019_challenge1 - 29 entries

For the Citizen Hacks 2019 Vim competition

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

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
Applying same text modification in several lines - 2563 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 1
A simple change - 377 entries

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

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 2
Com(m)a Trouble - 2979 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 4
Quote modules (ver.2) - 112 entries

Complete golang import statement.

  • Best score: 22
  • Best player score: 24
  • Number of attempts: 3
Swap values - 4261 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 1
Add semicolons - 9016 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 3
Replace pattern with 1, 2, 3, ... on each line - 606 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

  • Best score: 21
  • Best player score: 22
  • Number of attempts: 2
Remove semicolons after expressions - 499 entries

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

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 3
-a-b-c- - 2959 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 2
Extract argument from function - 2138 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 2
Bad Copy Syntax - 1733 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 10
  • Best player score: 20
  • Number of attempts: 5
Condensed Cases - 729 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
  • Number of attempts: 3
Copy three lines - 2574 entries

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

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
From A to B - 532 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 2
comment and uncomment code inline - 950 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: 10
  • Number of attempts: 3
Vertical Limit - 2252 entries

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

  • Best score: 21
  • Best player score: 26
  • Number of attempts: 3
Gray area - 669 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 2
Combines all items - 255 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
prepend * to every non-blank line - 4466 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 4
Context insensitive completion 0 - 461 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10271 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Collect List - 4008 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Swap values inside brackets - 2257 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 2
Line under headers - 1628 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 27
  • Number of attempts: 6
Add text at some column - 112 entries

Complete golang struct statement.

  • Best score: 31
  • Best player score: 32
  • Number of attempts: 4
V to the i - 4465 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
One to Ten - 1845 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 3
Ruby 1.9 hashes - 1113 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: 12
  • Best player score: 13
  • Number of attempts: 2
Let's play some Ivmgolf - 975 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 1
Ruby 1.9 compat - 566 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: 15
  • Number of attempts: 2
Quote modules - 796 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 28
  • Number of attempts: 1
Just the middle - 10718 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
Append semicolon after expressions - 898 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
Where should I put the Newline? - 830 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Don't know what this is - 1884 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: 13
  • Number of attempts: 4
Delete to the end of the current line - 691 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 2
Swap the operands under comparison - 240 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 2
Interweave two blocks of text - 522 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: 21
  • Number of attempts: 1
xrandr outputs and dashes - 379 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
quotes inside quotes - 2966 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: 14
  • Number of attempts: 3
remove lines containing the word "reader" - 3172 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 1
Split line with dots - 2029 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 2
Team names - 1675 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 24
  • Number of attempts: 1
Hogwarts Email Sorting - 629 entries

Given a list of emails, get the students full name and their associated house.

  • Best score: 20
  • Best player score: 22
  • Number of attempts: 2
multiple cursor alternative - 1363 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: 21
  • Number of attempts: 2
replacing each line of a block selection - 2706 entries

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

  • Best score: 18
  • Best player score: 20
  • Number of attempts: 2
ninja substitution - 1087 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 4
Get mail address from outlook format - 421 entries

Create a mail list space separated of mail list formatted by outlook

  • Best score: 15
  • Best player score: 19
  • Number of attempts: 1
From argument to object - 1230 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: 18
  • Number of attempts: 1
Two pairs of cluster of letters creates word - 656 entries

Clean and group.

  • Best score: 17
  • Best player score: 24
  • Number of attempts: 1
I forgot quotes - 14981 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 2
Ryan Nevius
Twitter:

entered into 64 challenges

contributed 0 challenges