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

HS exam question - 1599 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 92
  • Position: #317 / 419
  • Number of attempts: 7
delete swap - 1818 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #163 / 567
  • Number of attempts: 4
Fix the shell script! - 2651 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 30
  • Position: #241 / 616
  • Number of attempts: 7
hello-world-vimgolf - 2513 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #410 / 717
  • Number of attempts: 7
Inverting Lines - 1932 entries

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

  • Best score: 10
  • Best player score: 12
  • Position: #287 / 518
  • Number of attempts: 2
Python dataclasses - 1229 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 20
  • Position: #108 / 308
  • Number of attempts: 6
RUST Cargo.toml version to last - 378 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #39 / 104
  • Number of attempts: 5
swap number pairs - 2146 entries

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

  • Best score: 16
  • Best player score: 26
  • Position: #204 / 390
  • Number of attempts: 10
HS Final exam vimgolf - 913 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #151 / 241
  • Number of attempts: 1
Turn the x - 328 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 39
  • Position: #82 / 82
  • Number of attempts: 1
Rural Post - 4572 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #259 / 1116
  • Number of attempts: 5
Satisfy the go linter - 2468 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: 27
  • Position: #319 / 491
  • Number of attempts: 2
Multiline to Single Line - 747 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #69 / 318
  • Number of attempts: 7
Yo To Hello - 1152 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #190 / 534
  • Number of attempts: 4
Replace pattern with 1, 2, 3, ... on each line - 1151 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: 28
  • Position: #129 / 233
  • Number of attempts: 5
Simple, Practical, and Common - 33866 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: #2789 / 7474
  • Number of attempts: 3
Hogwarts Email Sorting - 944 entries

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

  • Best score: 20
  • Best player score: 22
  • Position: #178 / 267
  • Number of attempts: 3
Swap values - 4661 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #328 / 1282
  • Number of attempts: 7
prepend * to every non-blank line - 6366 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #252 / 1555
  • Number of attempts: 12
One number per line - 18831 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 23
  • Position: #3116 / 3889
  • Number of attempts: 3
Quote modules - 1095 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 43
  • Position: #270 / 286
  • Number of attempts: 2
Swap values inside brackets - 2523 entries

Easy challenge.

  • Best score: 13
  • Best player score: 15
  • Position: #208 / 587
  • Number of attempts: 15
Add string initializers to an enum - 892 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 26
  • Position: #176 / 263
  • Number of attempts: 2
Add semicolons - 10916 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #599 / 3085
  • Number of attempts: 5
Bad Copy Syntax - 2055 entries

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

  • Best score: 18
  • Best player score: 25
  • Position: #383 / 536
  • Number of attempts: 5
remove lines containing the word "reader" - 3622 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #428 / 1177
  • Number of attempts: 7
Com(m)a Trouble - 3941 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #323 / 892
  • Number of attempts: 4
Cool or not? - 842 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 16
  • Position: #119 / 233
  • Number of attempts: 11
Every other line - 2925 entries

AaAaAaA

  • Best score: 12
  • Best player score: 20
  • Position: #621 / 707
  • Number of attempts: 2
Copy three lines - 2882 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #273 / 642
  • Number of attempts: 12
Search and Replace 0 - 5027 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #654 / 1637
  • Number of attempts: 3
Just the middle - 11541 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3100 / 4230
  • Number of attempts: 3
Team names - 1848 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 19
  • Position: #467 / 592
  • Number of attempts: 1
Todo list specification - 405 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 37
  • Position: #79 / 183
  • Number of attempts: 5
Basic renumbering - 5699 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #229 / 1273
  • Number of attempts: 3
Simple addition - 332 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 12
  • Position: #48 / 124
  • Number of attempts: 12
Hidden Message - 93 entries

Find the hidden message and replace all other characters with spaces.

  • Best score: 33
  • Best player score: 51
  • Position: #26 / 30
  • Number of attempts: 3
ninja substitution - 1427 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Position: #67 / 269
  • Number of attempts: 14
Vice versa - 7974 entries

Little role switching.

  • Best score: 12
  • Best player score: 23
  • Position: #1978 / 2146
  • Number of attempts: 1
Pretty multi-line bash - 235 entries

Bash line continuations are much prettier when they're column aligned.

  • Best score: 15
  • Best player score: 27
  • Position: #55 / 77
  • Number of attempts: 11
Scrambled numbers - 814 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 32
  • Position: #156 / 185
  • Number of attempts: 5
One to Ten - 2241 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
  • Position: #293 / 682
  • Number of attempts: 8
Change part of a function name in multiple occurrences - 672 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: 14
  • Position: #58 / 210
  • Number of attempts: 4
Increment each number - 1043 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 27
  • Position: #220 / 255
  • Number of attempts: 17
Array transposition - 2436 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 28
  • Position: #350 / 452
  • Number of attempts: 4
Assign numbers to fields - 116 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 19
  • Position: #23 / 62
  • Number of attempts: 4
Swap assigned value - 671 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #97 / 259
  • Number of attempts: 7
Collect List - 4317 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #492 / 1194
  • Number of attempts: 13
VimGolfNight - 575 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #273 / 352
  • Number of attempts: 3
Square numbers - 123 entries

Boring math puzzle.

  • Best score: 16
  • Best player score: 39
  • Position: #38 / 42
  • Number of attempts: 4
I forgot quotes - 16093 entries

Oops.

  • Best score: 10
  • Best player score: 18
  • Position: #3389 / 4202
  • Number of attempts: 5
learn vim in short time - 242 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 9
  • Position: #148 / 162
  • Number of attempts: 4
Subtraction - 180 entries

Solve the equations.

  • Best score: 18
  • Best player score: 50
  • Position: #60 / 62
  • Number of attempts: 2
-a-b-c- - 3225 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #411 / 1140
  • Number of attempts: 7
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #130 / 354
  • Number of attempts: 10
Don't know what this is - 2025 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
  • Position: #124 / 587
  • Number of attempts: 7
quotes inside quotes - 3185 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: 15
  • Position: #508 / 1086
  • Number of attempts: 7
Words in parens - 12992 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2754 / 3977
  • Number of attempts: 4
Draw the Go board - 149 entries

which is a 19×19 lines board. Here we use ascii characters only for simplicity. See diff file to get a sense. (See also http://en.wikipedia.org/wiki/Go_(game))

  • Best score: 50
  • Best player score: 93
  • Position: #48 / 51
  • Number of attempts: 2
Delete unwanted lines - 431 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #180 / 234
  • Number of attempts: 4
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 35
  • Position: #83 / 174
  • Number of attempts: 6
Checkerboard case pattern - 164 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 24
  • Position: #48 / 61
  • Number of attempts: 20
NATO phonetic alphabet - 538 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 22
  • Position: #122 / 197
  • Number of attempts: 4
Simple Maths 2 - 44 entries

Time to practice expression register! #maths #linear

  • Best score: 17
  • Best player score: 40
  • Position: #16 / 16
  • Number of attempts: 1
Vertical Limit - 2596 entries

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

  • Best score: 21
  • Best player score: 26
  • Position: #505 / 767
  • Number of attempts: 9
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 40
  • Position: #197 / 199
  • Number of attempts: 1
switch variable - 5094 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #986 / 1754
  • Number of attempts: 2
The meaning - 577 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #296 / 364
  • Number of attempts: 5
HTML to Haml - 881 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 69
  • Position: #197 / 205
  • Number of attempts: 1
Shebangs for all - 2049 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: 12
  • Position: #158 / 523
  • Number of attempts: 13
Reverse and count - 486 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 21
  • Position: #27 / 179
  • Number of attempts: 11
Reverse Simple Deletion - 862 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Position: #46 / 463
  • Number of attempts: 3
Almost encrypted - 204 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 397
  • Position: #146 / 146
  • Number of attempts: 3
Simple text editing with Vim - 13262 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2360 / 3810
  • Number of attempts: 4
mindgitrwx
Twitter:

I use this twitter account as an index table

entered into 74 challenges

contributed 0 challenges