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 - 769 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: #77 / 184
  • Number of attempts: 2
Reformat symbols in list - 1648 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #132 / 354
  • Number of attempts: 10
Fizzbuzz - 612 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 44
  • Best player score: 59
  • Position: #44 / 171
  • Number of attempts: 7
Many duplicates - 1472 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #155 / 480
  • Number of attempts: 4
delete swap - 1834 entries

delete all swap

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

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 31
  • Position: #276 / 619
  • Number of attempts: 5
Wikitext headings to markdown - 1029 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 26
  • Position: #118 / 213
  • Number of attempts: 6
hello-world-vimgolf - 2523 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #42 / 274
  • Number of attempts: 4
Fill in the chess board - 979 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: #117 / 186
  • Number of attempts: 1
Plotting some variables in python - 1683 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 / 352
  • Number of attempts: 9
Lowercase first characters - 499 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 / 185
  • Number of attempts: 3
Migrated to Postgres! - 348 entries

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

  • Best score: 26
  • Best player score: 29
  • Position: #64 / 134
  • Number of attempts: 3
Increment number for every 10 lines - 245 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: #53 / 66
  • Number of attempts: 3
simple replacements - 1861 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #134 / 399
  • Number of attempts: 8
Inverting Lines - 1952 entries

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

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

Simple challenge to extract fields from a Python class

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 51
  • Position: #240 / 331
  • Number of attempts: 2
swap number pairs - 2168 entries

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

  • Best score: 16
  • Best player score: 26
  • Position: #204 / 392
  • Number of attempts: 6
HS Final exam vimgolf - 933 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: #173 / 244
  • Number of attempts: 3
Easy modification of ssh config - 397 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 38
  • Position: #83 / 116
  • Number of attempts: 1
Add quotes to ansible playbook - 1036 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #196 / 327
  • Number of attempts: 3
Simple, Practical, and Common - 33927 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 / 7488
  • Number of attempts: 5
One number per line - 18840 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2320 / 3893
  • Number of attempts: 4
V to the i - 4833 entries

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

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

Change Typescript enum so that it has string initializers.

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

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #525 / 707
  • Number of attempts: 4
Extract argument from function - 2379 entries

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

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

"vim vi improved"

  • Best score: 9
  • Best player score: 18
  • Position: #651 / 704
  • Number of attempts: 1
Interweave two blocks of text - 661 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: #64 / 215
  • Number of attempts: 3
Basic renumbering - 5707 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #265 / 1274
  • Number of attempts: 3
Add to end of each line... kinda - 339 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: #175 / 176
  • Number of attempts: 1
Combines all items - 313 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 / 140
  • Number of attempts: 5
ninja substitution - 1436 entries

How can you reuse a previous substitution ?

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

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #607 / 2147
  • Number of attempts: 5
Free hyphen! - 182 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 / 92
  • Number of attempts: 4
Order and join - 992 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 12
  • Position: #173 / 261
  • Number of attempts: 5
Paragraph breaks - 527 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 11
  • Position: #88 / 168
  • Number of attempts: 5
Scrambled numbers - 814 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 33
  • Position: #160 / 185
  • Number of attempts: 1
Collect List - 4317 entries

Convert to comma separated list.

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

add a prefix on some camelCase variables

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

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 18
  • Position: #229 / 446
  • Number of attempts: 2
Mute the second method of this script - 456 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 9
  • Position: #149 / 240
  • Number of attempts: 2
I forgot quotes - 16127 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2044 / 4208
  • Number of attempts: 2
-a-b-c- - 3225 entries

Put hyphens everywhere.

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

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #277 / 354
  • Number of attempts: 2
Gray area - 749 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 17
  • Position: #263 / 272
  • Number of attempts: 1
Split the words - 372 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: #106 / 112
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10720 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1591 / 3703
  • Number of attempts: 2
Letter case trickery - 1644 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 / 520
  • Number of attempts: 4
Words in parens - 13005 entries

We should all ace this, right?

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

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

  • Best score: 18
  • Best player score: 27
  • Position: #595 / 783
  • Number of attempts: 3
Case preserving word replacement - 463 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 / 182
  • Number of attempts: 3
Insert a Markdown link - 465 entries

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

  • Best score: 22
  • Best player score: 27
  • Position: #114 / 154
  • Number of attempts: 2
Numbering a List - 1941 entries

Pretty simple, number the list.

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

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #370 / 463
  • Number of attempts: 2
Remember FizzBuzz? - 787 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 59
  • Position: #115 / 204
  • Number of attempts: 1
Change the content of a string - 1741 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #203 / 636
  • Number of attempts: 7
Simple text editing with Vim - 13382 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 / 3839
  • Number of attempts: 2
Omar Alawadhi
Twitter:

entered into 60 challenges

contributed 0 challenges