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

hello-world-vimgolf - 337 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #61 / 110
  • Number of attempts: 1
Contribute to keyboard mashing - 293 entries

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #50 / 86
  • Number of attempts: 2
Reordering Lorem Ipsum - 74 entries

Who even sorted this?

  • Best score: 13
  • Best player score: 14
  • Position: #7 / 22
  • Number of attempts: 4
Fill in the chess board - 239 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 22
  • Position: #17 / 55
  • Number of attempts: 8
Learn to ask for :help - 228 entries

Learn to use the help to reduce your strokes...

  • Best score: 19
  • Best player score: 27
  • Position: #30 / 53
  • Number of attempts: 4
Plotting some variables in python - 637 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 41
  • Position: #53 / 129
  • Number of attempts: 3
Transpose a python matrix - 351 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 40
  • Position: #29 / 70
  • Number of attempts: 1
Lowercase first characters - 211 entries

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

  • Best score: 33
  • Best player score: 37
  • Position: #35 / 78
  • Number of attempts: 1
Migrated to Postgres! - 153 entries

Celebration completion of this project. https://github.com/igrigorik/vimgolf/pull/322

  • Best score: 26
  • Best player score: 29
  • Position: #35 / 66
  • Number of attempts: 2
simple replacements - 685 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 23
  • Position: #89 / 162
  • Number of attempts: 1
Inverting Lines - 1011 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 10
  • Position: #109 / 275
  • Number of attempts: 3
Generate a very basic Python constructor - 188 entries

I actually needed to do this myself, so I look forward to learning how.

  • Best score: 38
  • Best player score: 39
  • Position: #18 / 50
  • Number of attempts: 9
Python dataclasses - 424 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 20
  • Position: #48 / 120
  • Number of attempts: 1
RUST Cargo.toml version to last - 190 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

  • Best score: 16
  • Best player score: 25
  • Position: #48 / 59
  • Number of attempts: 2
Making 3 line function a one liner. - 94 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #51 / 68
  • Number of attempts: 1
Modernise code - 675 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 37
  • Position: #63 / 154
  • Number of attempts: 4
Staircase - 17 entries

Going downstairs, while singing the alphabet song. Some vb practice to us all. Would it be much easier to make it go from left to right instead?

  • Best score: 21
  • Best player score: 35
  • Position: #9 / 11
  • Number of attempts: 2
Enumerate Bullets - 140 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

  • Best score: 20
  • Best player score: 24
  • Position: #26 / 37
  • Number of attempts: 2
Put a cross in the square - 91 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 23
  • Position: #37 / 42
  • Number of attempts: 3
swap number pairs - 1294 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 22
  • Position: #102 / 244
  • Number of attempts: 6
HS Final exam vimgolf - 578 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 29
  • Position: #90 / 156
  • Number of attempts: 1
Easy modification of ssh config - 165 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 28
  • Position: #32 / 49
  • Number of attempts: 2
Change double quotes to single quotes, but with a twist - 214 entries

Although this challenge is in the context of a Python function, you don't need to know Python to do this challenge. It is to add contexts and interesting constraints. The file contains a function that prints a multi-line string literal. I wrote the string literal with double quotes, but then I decided to use single quotes instead, and that's your challenge. However, interestingly enough, the string itself contains single and double quotes. This means, inside the string literal, the originally escaped double quotes no longer need to be escaped, but the single quotes now need to be escaped. Note that the triple double quotes in the docstring should be left alone.

  • Best score: 22
  • Best player score: 35
  • Position: #25 / 44
  • Number of attempts: 4
C to python code snippet - 44 entries

C code can be easily translated into Python code. However, the difference in syntax can make this process tedious and time-consuming. Can Vim help you here?

  • Best score: 48
  • Best player score: 53
  • Position: #8 / 15
  • Number of attempts: 4
Mr. Hacker - 34 entries

Elvin is hacker. He has piece of users database from some social net site. Recently he installed Vim, and he wants to convert CSV DB to specific format `key=value' where `key' is login and `value' is password, but password in DB is encrypted in ROT13. Help him.

  • Best score: 19
  • Best player score: 21
  • Position: #15 / 17
  • Number of attempts: 1
Python: Def to Lambda - 221 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 20
  • Position: #59 / 80
  • Number of attempts: 2
Format the CSS - 57 entries

You just copied some CSS color names from the web and need to add them to your python module. Create the COLORS variable and assign a dict() with the names as keys and hex-colors as values. BEWARE OF THE TABS!!

  • Best score: 41
  • Best player score: 44
  • Position: #11 / 24
  • Number of attempts: 3
Rural Post - 3800 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #392 / 939
  • Number of attempts: 3
Levenshtein distance - 70 entries

Compute distance for each pair. Notice that this recursive implementation is very inefficient. Wagner-Fischer algorithm is iterative and much faster. #vimscript

  • Best score: 28
  • Best player score: 30
  • Position: #5 / 25
  • Number of attempts: 4
Satisfy the go linter - 1625 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 21
  • Position: #124 / 334
  • Number of attempts: 2
Add quotes to ansible playbook - 597 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #24 / 190
  • Number of attempts: 4
Multiline to Single Line - 378 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #153 / 179
  • Number of attempts: 1
Data reformat - 219 entries

Reformat this copy-paste data! #csv

  • Best score: 38
  • Best player score: 42
  • Position: #19 / 53
  • Number of attempts: 4
xrandr outputs and dashes - 568 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
  • Position: #119 / 184
  • Number of attempts: 1
From a Thunderlink to a Markdown link - 659 entries

ThunderLinks are durable hyperlinks to specific email messages generated from Thunderbird in HTML format. Leverage the power of vim to make them suitable for a markdown-formatted file.

  • Best score: 18
  • Best player score: 24
  • Position: #105 / 145
  • Number of attempts: 2
Capitalize the Names - 284 entries

I want to capitalize the names in quotes, but just the people's names, not the file names.

  • Best score: 21
  • Best player score: 25
  • Position: #41 / 72
  • Number of attempts: 3
Yo To Hello - 983 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #284 / 454
  • Number of attempts: 2
Replace pattern with 1, 2, 3, ... on each line - 954 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: 31
  • Position: #135 / 193
  • Number of attempts: 2
Simple, Practical, and Common - 32778 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: 23
  • Position: #2723 / 7242
  • Number of attempts: 2
Hogwarts Email Sorting - 806 entries

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

  • Best score: 20
  • Best player score: 22
  • Position: #142 / 231
  • Number of attempts: 1
prepend * to every non-blank line - 5829 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #601 / 1434
  • Number of attempts: 2
One number per line - 18295 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #739 / 3770
  • Number of attempts: 4
Quote modules - 985 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 25
  • Position: #118 / 252
  • Number of attempts: 3
Unsemantic linewrapping - 821 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

  • Best score: 9
  • Best player score: 13
  • Position: #172 / 205
  • Number of attempts: 1
V to the i - 4617 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1459 / 1847
  • Number of attempts: 1
Applying same text modification in several lines - 2713 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #444 / 807
  • Number of attempts: 2
Add semicolons - 10467 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1539 / 2966
  • Number of attempts: 1
remove lines containing the word "reader" - 3436 entries

easy stuff

  • Best score: 9
  • Best player score: 11
  • Position: #889 / 1113
  • Number of attempts: 3
Box it - 7661 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 36
  • Position: #1615 / 1830
  • Number of attempts: 1
multiple cursor alternative - 1441 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: 23
  • Position: #269 / 368
  • Number of attempts: 3
From argument to object - 1258 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
  • Position: #238 / 416
  • Number of attempts: 2
Copy three lines - 2767 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #266 / 620
  • Number of attempts: 2
Search and Replace 0 - 4591 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #657 / 1521
  • Number of attempts: 3
Just the middle - 11086 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3133 / 4093
  • Number of attempts: 2
Team names - 1767 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 18
  • Position: #387 / 566
  • Number of attempts: 1
Interweave two blocks of text - 550 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: 16
  • Position: #53 / 198
  • Number of attempts: 4
Subnetting - 94 entries

Split up the IP addresses in the right way.

  • Best score: 29
  • Best player score: 34
  • Position: #15 / 31
  • Number of attempts: 6
Python Hello World! Reformatting - 881 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 43
  • Position: #175 / 340
  • Number of attempts: 1
Basic renumbering - 5408 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #237 / 1221
  • Number of attempts: 1
Adam's challenge - 912 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 22
  • Position: #185 / 255
  • Number of attempts: 1
sort python functions and methods alphabetically - 18 entries

* sort functions in the python file alphabetically * sort functions within a Class alphabetically * sort Classes alphabetically

  • Best score: 20
  • Best player score: 23
  • Position: #7 / 11
  • Number of attempts: 1
Create a table - 293 entries

Convert the given input into a formatted table

  • Best score: 16
  • Best player score: 18
  • Position: #64 / 96
  • Number of attempts: 2
Wrap text in quotes - 328 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #94 / 112
  • Number of attempts: 2
ninja substitution - 1278 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 15
  • Position: #126 / 245
  • Number of attempts: 4
Vice versa - 7462 entries

Little role switching.

  • Best score: 12
  • Best player score: 17
  • Position: #1618 / 2023
  • Number of attempts: 1
Paragraph sort - 397 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #69 / 115
  • Number of attempts: 3
SQL to YAML - 45 entries

Should be easy with vim, or not?

  • Best score: 72
  • Best player score: 86
  • Position: #11 / 20
  • Number of attempts: 2
Order and join - 858 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #123 / 236
  • Number of attempts: 2
Increment each number - 946 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 22
  • Position: #179 / 233
  • Number of attempts: 2
Around the clock - 174 entries

You'll want to use 2 special commands to complete this. If you haven't yet, read through 'input.txt', especially :help simple-changes

  • Best score: 13
  • Best player score: 14
  • Position: #46 / 67
  • Number of attempts: 2
Join 'em - 217 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 5
  • Position: #114 / 127
  • Number of attempts: 1
Array transposition - 2271 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 26
  • Position: #302 / 427
  • Number of attempts: 1
From A to B - 539 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #92 / 150
  • Number of attempts: 6
Rail fence transposition cipher - 70 entries

Solve a rail fence transposition cipher using vim. This ciphertext was created using two rails. Use vim to transpose the text and recover the original quote.

  • Best score: 14
  • Best player score: 15
  • Position: #9 / 24
  • Number of attempts: 7
Land of the Lost - 76 entries

Enter the tabs below the lyrics

  • Best score: 26
  • Best player score: 32
  • Position: #6 / 29
  • Number of attempts: 5
readability - 304 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 19
  • Position: #129 / 144
  • Number of attempts: 6
Interleave lines - 133 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: 18
  • Position: #9 / 54
  • Number of attempts: 6
Logging with key - 287 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 23
  • Position: #32 / 82
  • Number of attempts: 4
Space out the alphabet - 1563 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 22
  • Position: #326 / 427
  • Number of attempts: 1
Not enough Ps - 65 entries

Different type of code

  • Best score: 13
  • Best player score: 13
  • Position: #26 / 34
  • Number of attempts: 4
Merge blank lines and properly capitalize - 49 entries

Here you need complete 2 tasks: 1. Remove all unwanted continuous blank lines and leave only 1 blank line between paragraphs. 2. Properly capitalize the sentences.

  • Best score: 21
  • Best player score: 23
  • Position: #8 / 18
  • Number of attempts: 8
Shuffled numbers - 205 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 17
  • Position: #72 / 86
  • Number of attempts: 2
Mute the second method of this script - 430 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #142 / 229
  • Number of attempts: 1
Remove hard line breaks - 51 entries

Text files with Hard breaks are not good for e-readers. We need remove all hard line breaks and have long lines.

  • Best score: 10
  • Best player score: 17
  • Position: #20 / 27
  • Number of attempts: 8
Winning streak - 113 entries

Make the number on each line equal the consecutive L's or W's.

  • Best score: 21
  • Best player score: 26
  • Position: #21 / 48
  • Number of attempts: 8
Happy TvvO - 379 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #180 / 190
  • Number of attempts: 1
I forgot quotes - 15668 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1973 / 4099
  • Number of attempts: 2
Subtraction - 167 entries

Solve the equations.

  • Best score: 18
  • Best player score: 27
  • Position: #39 / 57
  • Number of attempts: 4
-a-b-c- - 3085 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #403 / 1101
  • Number of attempts: 2
120 Degrees - 416 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #33 / 137
  • Number of attempts: 8
Comparing scores - 83 entries

If Alice and Bob both did the challenge, put their entries together in the top paragraph, so we can compare their scores more easily.

  • Best score: 18
  • Best player score: 22
  • Position: #15 / 31
  • Number of attempts: 5
Do you demand a shrubbery? - 1089 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 16
  • Position: #96 / 288
  • Number of attempts: 7
Where should I put the Newline? - 833 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #394 / 417
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 330 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: 16
  • Position: #56 / 100
  • Number of attempts: 2
Words in parens - 12690 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1809 / 3906
  • Number of attempts: 2
It's a factor - 85 entries

Flaunt your macro prowess by factoring some numbers. Too hard? It takes less than 30 strokes, I promise.

  • Best score: 25
  • Best player score: 65
  • Position: #20 / 35
  • Number of attempts: 5
Fibonacci Triangles - 47 entries

Triangles

  • Best score: 40
  • Best player score: 45
  • Position: #10 / 19
  • Number of attempts: 6
Circle of Fifths with Sharps - 82 entries

Display a list of the Circle of Fifths with corresponding solfege syllables with sharps. Handling spaces may be tricky.

  • Best score: 24
  • Best player score: 24
  • Position: #10 / 33
  • Number of attempts: 4
Dehamlizing - 170 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 34
  • Position: #8 / 65
  • Number of attempts: 5
NATO phonetic alphabet - 459 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 20
  • Position: #51 / 173
  • Number of attempts: 4
The name of the game - 614 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #260 / 334
  • Number of attempts: 3
maximun and minimun - 52 entries

Find the maximum and minimum of the rows.

  • Best score: 51
  • Best player score: 96
  • Position: #21 / 22
  • Number of attempts: 2
Vertical Limit - 2333 entries

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

  • Best score: 21
  • Best player score: 26
  • Position: #472 / 708
  • Number of attempts: 1
switch variable - 4881 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #959 / 1694
  • Number of attempts: 2
Multiplication table. - 190 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 41
  • Position: #5 / 61
  • Number of attempts: 7
Alphabetize the directory - 267 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 31
  • Position: #22 / 96
  • Number of attempts: 6
Case preserving word replacement - 415 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 20
  • Position: #75 / 170
  • Number of attempts: 8
Table Reshuffle - 328 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 24
  • Position: #33 / 122
  • Number of attempts: 2
Increment, increment, increment.... - 537 entries

Vim likes macros

  • Best score: 10
  • Best player score: 11
  • Position: #41 / 361
  • Number of attempts: 1
Hatsuyume - 381 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 16
  • Best player score: 18
  • Position: #12 / 156
  • Number of attempts: 1
Context insensitive completion 0 - 464 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: 7
  • Best player score: 7
  • Position: #108 / 218
  • Number of attempts: 1
mevmev
Twitter:

entered into 111 challenges

contributed 0 challenges