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

Filename Flip - 196 entries

Rearrange the MP3 filenames so that the identifier comes before the name.

  • Best score: 15
  • Best player score: 27
  • Position: #57 / 70
  • Number of attempts: 1
Delete the last function argument in python. - 729 entries

Delete the last function argument in this python script.

  • Best score: 6
  • Best player score: 6
  • Position: #142 / 261
  • Number of attempts: 1
Flip All Bits - 503 entries

Perform a bitwise NOT operation on each bit, meaning that bits that are 0 become 1, and those that are 1 become 0.

  • Best score: 24
  • Best player score: 47
  • Position: #93 / 144
  • Number of attempts: 1
Create json from a .env file - 1773 entries

A simple everyday task.

  • Best score: 38
  • Best player score: 91
  • Position: #359 / 431
  • Number of attempts: 1
YAML to dotenv - 1654 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 32
  • Position: #253 / 347
  • Number of attempts: 1
Swap columns and transform to CSV format - 516 entries

Turn this spreadsheet output into a CSV file but first swap the columns

  • Best score: 16
  • Best player score: 30
  • Position: #165 / 184
  • Number of attempts: 1
Change class fields from snake case to camel case - 336 entries

Change the class fields in this Scala class from snake case to camel case

  • Best score: 13
  • Best player score: 21
  • Position: #117 / 127
  • Number of attempts: 1
Replace csv column if it's not empty - 317 entries

Replace the credit_score_percentile column with the value 0.0 but leave the empty ones untouched

  • Best score: 15
  • Best player score: 21
  • Position: #91 / 103
  • Number of attempts: 2
Column wise pasting - 282 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 73
  • Position: #60 / 63
  • Number of attempts: 2
New teacher - 1534 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 35
  • Position: #291 / 322
  • Number of attempts: 1
Quicksort - 2114 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 30
  • Position: #366 / 473
  • Number of attempts: 1
Populate 3D bone names list - 661 entries

Ran into this at work, excited to see how this gets optimized

  • Best score: 21
  • Best player score: 36
  • Position: #135 / 172
  • Number of attempts: 1
Find fix point of cos - 1486 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 19
  • Position: #334 / 435
  • Number of attempts: 1
Insert column data on Confluence-style table - 504 entries

Add ip addresses into new "IP" column based on the last digits from the "Server" column

  • Best score: 33
  • Best player score: 184
  • Position: #111 / 115
  • Number of attempts: 1
Reformat symbols in list - 1661 entries

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

  • Best score: 24
  • Best player score: 30
  • Position: #209 / 358
  • Number of attempts: 3
delete swap - 1918 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #401 / 583
  • Number of attempts: 1
Fix the shell script! - 2710 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 47
  • Position: #511 / 637
  • Number of attempts: 1
hello-world-vimgolf - 2535 entries

Simple number generation

  • Best score: 6
  • Best player score: 15
  • Position: #583 / 728
  • Number of attempts: 1
simple replacements - 1910 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 28
  • Position: #350 / 417
  • Number of attempts: 2
Making 3 line function a one liner. - 349 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #191 / 215
  • Number of attempts: 2
Rural Post - 4604 entries

Simple challenge to remove all but the post code on each line

  • Best score: 7
  • Best player score: 15
  • Position: #790 / 1126
  • Number of attempts: 1
Add quotes to ansible playbook - 1065 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 18
  • Position: #338 / 347
  • Number of attempts: 1
Simple, Practical, and Common - 34031 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: 34
  • Position: #6530 / 7520
  • Number of attempts: 1
prepend * to every non-blank line - 6401 entries

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

  • Best score: 7
  • Best player score: 13
  • Position: #861 / 1566
  • Number of attempts: 1
One number per line - 18907 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2607 / 3907
  • Number of attempts: 1
citizen_hacks_2019_challenge2 - 210 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 7
  • Position: #101 / 109
  • Number of attempts: 1
Swap values inside brackets - 2553 entries

Easy challenge.

  • Best score: 10
  • Best player score: 75
  • Position: #587 / 595
  • Number of attempts: 1
V to the i - 4890 entries

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

  • Best score: 7
  • Best player score: 9
  • Position: #1764 / 1917
  • Number of attempts: 1
Applying same text modification in several lines - 2937 entries

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

  • Best score: 7
  • Best player score: 33
  • Position: #814 / 869
  • Number of attempts: 1
Add string initializers to an enum - 904 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 30
  • Position: #244 / 267
  • Number of attempts: 1
Add semicolons - 10966 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 12
  • Position: #1982 / 3100
  • Number of attempts: 2
remove lines containing the word "reader" - 3661 entries

easy stuff

  • Best score: 7
  • Best player score: 10
  • Position: #886 / 1189
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 885 entries

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

  • Best score: 5
  • Best player score: 20
  • Position: #449 / 458
  • Number of attempts: 1
Box it - 8004 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 43
  • Position: #1771 / 1902
  • Number of attempts: 1
Extract argument from function - 2430 entries

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

  • Best score: 13
  • Best player score: 53
  • Position: #774 / 774
  • Number of attempts: 1
Search and Replace 0 - 5170 entries

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

  • Best score: 7
  • Best player score: 15
  • Position: #1175 / 1680
  • Number of attempts: 1
That hyphen - 2650 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 21
  • Position: #694 / 713
  • Number of attempts: 1
comment and uncomment code inline - 1183 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: 19
  • Position: #319 / 333
  • Number of attempts: 1
Just the middle - 11636 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3257 / 4262
  • Number of attempts: 3
Basic renumbering - 5735 entries

Renumbering Basic.

  • Best score: 7
  • Best player score: 30
  • Position: #1233 / 1282
  • Number of attempts: 1
Vice versa - 8021 entries

Little role switching.

  • Best score: 12
  • Best player score: 33
  • Position: #2089 / 2158
  • Number of attempts: 1
change parenthesis - 312 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 10
  • Position: #155 / 166
  • Number of attempts: 1
Space out the alphabet - 1700 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 19
  • Position: #267 / 460
  • Number of attempts: 1
Mute the second method of this script - 466 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 10
  • Position: #229 / 247
  • Number of attempts: 1
I forgot quotes - 16255 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #3120 / 4229
  • Number of attempts: 2
-a-b-c- - 3243 entries

Put hyphens everywhere.

  • Best score: 6
  • Best player score: 15
  • Position: #748 / 1148
  • Number of attempts: 1
Winding path - 144 entries

It's a maze, but the bad paths have been blocked off. Mark the correct path.

  • Best score: 27
  • Best player score: 133
  • Position: #42 / 44
  • Number of attempts: 1
Where should I put the Newline? - 916 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 17
  • Position: #453 / 453
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10757 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 17
  • Position: #3448 / 3717
  • Number of attempts: 1
quotes inside quotes - 3210 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: 7
  • Best player score: 17
  • Position: #963 / 1097
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 378 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

  • Best score: 15
  • Best player score: 30
  • Position: #106 / 113
  • Number of attempts: 1
Words in parens - 13063 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 18
  • Position: #3033 / 3995
  • Number of attempts: 1
paste indent correction - JS - 126 entries

You copy some javascript code from a website and paste it into vim, it does not look good!

  • Best score: 16
  • Best player score: 21
  • Position: #59 / 64
  • Number of attempts: 1
Delete unwanted lines - 452 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 12
  • Position: #230 / 238
  • Number of attempts: 1
Prefixes and suffixes - 670 entries

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

  • Best score: 17
  • Best player score: 34
  • Position: #183 / 209
  • Number of attempts: 1
NATO phonetic alphabet - 555 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 34
  • Position: #198 / 202
  • Number of attempts: 1
The name of the game - 707 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 13
  • Position: #350 / 374
  • Number of attempts: 1
lamb had a little Mary - 661 entries

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

  • Best score: 16
  • Best player score: 50
  • Position: #171 / 181
  • Number of attempts: 1
Saving the hashes(#) - 2118 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: 7
  • Best player score: 32
  • Position: #430 / 490
  • Number of attempts: 1
Let's play some Ivmgolf - 1167 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 13
  • Position: #434 / 462
  • Number of attempts: 1
Reverse and double space - 514 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 19
  • Position: #184 / 204
  • Number of attempts: 2
Remove semicolons after expressions - 690 entries

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

  • Best score: 6
  • Best player score: 10
  • Position: #260 / 272
  • Number of attempts: 3
switch variable - 5136 entries

how fast can you switch two variable ?

  • Best score: 9
  • Best player score: 27
  • Position: #1725 / 1767
  • Number of attempts: 2
A Simple One - 1096 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: 10
  • Position: #619 / 683
  • Number of attempts: 2
Increment, increment, increment.... - 712 entries

Vim likes macros

  • Best score: 10
  • Best player score: 13
  • Position: #398 / 420
  • Number of attempts: 1
The Cake is a Lie - 1422 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 11
  • Position: #480 / 546
  • Number of attempts: 1
Context Insensitive completion 1 - 536 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 24
  • Position: #217 / 254
  • Number of attempts: 1
Whitespace, empty lines and tabs - 4083 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 7
  • Best player score: 34
  • Position: #732 / 872
  • Number of attempts: 1
Simple text editing with Vim - 13682 entries

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

  • Best score: 13
  • Best player score: 26
  • Position: #3404 / 3920
  • Number of attempts: 1
Jon Garmilla
Github:

entered into 69 challenges

contributed 0 challenges