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

Tabbed Table to Python Array - 608 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 59
  • Position: #62 / 160
  • Number of attempts: 2
Reformat symbols in list - 1447 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #117 / 318
  • Number of attempts: 10
Fizzbuzz - 489 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 59
  • Position: #38 / 153
  • Number of attempts: 7
Many duplicates - 1218 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #145 / 397
  • Number of attempts: 4
delete swap - 1466 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #121 / 465
  • Number of attempts: 5
Fix the shell script! - 2065 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 31
  • Position: #226 / 497
  • Number of attempts: 5
Wikitext headings to markdown - 960 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 26
  • Position: #110 / 198
  • Number of attempts: 6
hello-world-vimgolf - 2311 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #224 / 653
  • Number of attempts: 6
Contribute to keyboard mashing - 828 entries

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #42 / 252
  • Number of attempts: 4
Fill in the chess board - 886 entries

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

  • Best score: 19
  • Best player score: 40
  • Position: #109 / 173
  • Number of attempts: 1
Plotting some variables in python - 1543 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: 34
  • Position: #43 / 329
  • Number of attempts: 9
Lowercase first characters - 458 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: 33
  • Position: #27 / 172
  • Number of attempts: 3
Migrated to Postgres! - 299 entries

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

  • Best score: 26
  • Best player score: 29
  • Position: #59 / 118
  • Number of attempts: 3
Increment number for every 10 lines - 213 entries

The file consists of 2 columns (code and percentage). We need to add 2 more columns with increasing number for 4th column (Xcols) and increment 3rd column (Ycols) only for every 10 lines with reset of 4th column

  • Best score: 25
  • Best player score: 70
  • Position: #47 / 59
  • Number of attempts: 3
simple replacements - 1536 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #122 / 336
  • Number of attempts: 8
Inverting Lines - 1797 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #170 / 486
  • Number of attempts: 6
Python dataclasses - 982 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 32
  • Position: #191 / 248
  • Number of attempts: 4
Making 3 line function a one liner. - 303 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #106 / 193
  • Number of attempts: 5
Modernise code - 1331 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 51
  • Position: #222 / 306
  • Number of attempts: 2
swap number pairs - 2002 entries

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

  • Best score: 16
  • Best player score: 26
  • Position: #193 / 369
  • Number of attempts: 6
HS Final exam vimgolf - 864 entries

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

  • Best score: 21
  • Best player score: 34
  • Position: #159 / 227
  • Number of attempts: 3
Easy modification of ssh config - 335 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 38
  • Position: #75 / 104
  • Number of attempts: 1
Add quotes to ansible playbook - 872 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #185 / 274
  • Number of attempts: 3
Simple, Practical, and Common - 33354 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: 22
  • Position: #2366 / 7358
  • Number of attempts: 5
One number per line - 18615 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2300 / 3841
  • Number of attempts: 4
V to the i - 4743 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #783 / 1878
  • Number of attempts: 2
Add string initializers to an enum - 862 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 21
  • Position: #70 / 254
  • Number of attempts: 6
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #521 / 700
  • Number of attempts: 4
Extract argument from function - 2308 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #267 / 742
  • Number of attempts: 3
That hyphen - 2554 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 18
  • Position: #645 / 694
  • Number of attempts: 1
Interweave two blocks of text - 631 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: #61 / 211
  • Number of attempts: 3
Basic renumbering - 5584 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #265 / 1257
  • Number of attempts: 3
Add to end of each line... kinda - 323 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: 20
  • Position: #169 / 170
  • Number of attempts: 1
Combines all items - 303 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #83 / 137
  • Number of attempts: 5
ninja substitution - 1372 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Position: #80 / 261
  • Number of attempts: 5
Vice versa - 7778 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #607 / 2095
  • Number of attempts: 5
Free hyphen! - 159 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 9
  • Position: #32 / 85
  • Number of attempts: 4
Order and join - 948 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 12
  • Position: #168 / 254
  • Number of attempts: 5
Paragraph breaks - 505 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 11
  • Position: #85 / 165
  • Number of attempts: 5
Scrambled numbers - 779 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 33
  • Position: #157 / 182
  • Number of attempts: 1
Collect List - 4261 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #521 / 1185
  • Number of attempts: 6
camel riding - 769 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Position: #73 / 274
  • Number of attempts: 5
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 18
  • Position: #227 / 440
  • Number of attempts: 2
Mute the second method of this script - 447 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #148 / 237
  • Number of attempts: 2
I forgot quotes - 15923 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2026 / 4159
  • Number of attempts: 2
-a-b-c- - 3170 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #310 / 1127
  • Number of attempts: 3
Count both ways - 997 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #274 / 350
  • Number of attempts: 2
Gray area - 724 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 17
  • Position: #259 / 267
  • Number of attempts: 1
Split the words - 356 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

  • Best score: 18
  • Best player score: 50
  • Position: #102 / 108
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1591 / 3663
  • Number of attempts: 2
Letter case trickery - 1594 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
  • Position: #37 / 511
  • Number of attempts: 4
Words in parens - 12850 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 13
  • Position: #13 / 3944
  • Number of attempts: 6
replacing each line of a block selection - 2925 entries

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

  • Best score: 18
  • Best player score: 27
  • Position: #582 / 764
  • Number of attempts: 3
Case preserving word replacement - 453 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: 19
  • Position: #67 / 179
  • Number of attempts: 3
Insert a Markdown link - 431 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 27
  • Position: #107 / 143
  • Number of attempts: 2
Numbering a List - 1855 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #76 / 638
  • Number of attempts: 1
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #366 / 454
  • Number of attempts: 2
Remember FizzBuzz? - 653 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 59
  • Position: #99 / 177
  • Number of attempts: 1
Change the content of a string - 1457 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #203 / 552
  • Number of attempts: 7
Simple text editing with Vim - 12233 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #679 / 3567
  • Number of attempts: 2
Omar Alawadhi
Twitter:

entered into 60 challenges

contributed 0 challenges