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 - 90 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: 52
  • Best player score: 59
  • Position: #11 / 31
  • Number of attempts: 2
Reformat symbols in list - 662 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #60 / 150
  • Number of attempts: 10
Fizzbuzz - 236 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 59
  • Position: #25 / 73
  • Number of attempts: 7
Many duplicates - 610 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #127 / 212
  • Number of attempts: 4
delete swap - 740 entries

delete all swap

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

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 31
  • Position: #160 / 347
  • Number of attempts: 5
Wikitext headings to markdown - 709 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 26
  • Position: #83 / 157
  • Number of attempts: 6
hello-world-vimgolf - 1762 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #42 / 214
  • Number of attempts: 4
Fill in the chess board - 665 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: #90 / 140
  • Number of attempts: 1
Plotting some variables in python - 1269 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 / 270
  • Number of attempts: 9
Lowercase first characters - 387 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 / 142
  • Number of attempts: 3
Migrated to Postgres! - 244 entries

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

  • Best score: 26
  • Best player score: 29
  • Position: #56 / 96
  • Number of attempts: 3
Increment number for every 10 lines - 173 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: #39 / 50
  • Number of attempts: 3
simple replacements - 1177 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #103 / 262
  • Number of attempts: 8
Inverting Lines - 1447 entries

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

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

Simple challenge to extract fields from a Python class

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 51
  • Position: #165 / 225
  • Number of attempts: 2
swap number pairs - 1675 entries

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

  • Best score: 16
  • Best player score: 26
  • Position: #166 / 313
  • Number of attempts: 6
HS Final exam vimgolf - 746 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: #142 / 201
  • Number of attempts: 3
Easy modification of ssh config - 265 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 38
  • Position: #61 / 86
  • Number of attempts: 1
Add quotes to ansible playbook - 822 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #183 / 258
  • Number of attempts: 3
Simple, Practical, and Common - 33029 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: #2367 / 7290
  • Number of attempts: 5
One number per line - 18439 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2276 / 3802
  • Number of attempts: 4
V to the i - 4647 entries

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

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

Change Typescript enum so that it has string initializers.

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

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #516 / 690
  • Number of attempts: 4
Extract argument from function - 2261 entries

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

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

"vim vi improved"

  • Best score: 9
  • Best player score: 18
  • Position: #639 / 688
  • Number of attempts: 1
Interweave two blocks of text - 613 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: #60 / 208
  • Number of attempts: 3
Basic renumbering - 5477 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #265 / 1238
  • Number of attempts: 3
Add to end of each line... kinda - 307 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: #162 / 163
  • Number of attempts: 1
Combines all items - 290 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 / 131
  • Number of attempts: 5
ninja substitution - 1324 entries

How can you reuse a previous substitution ?

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

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #607 / 2059
  • Number of attempts: 5
Free hyphen! - 156 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 / 84
  • Number of attempts: 4
Order and join - 900 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 12
  • Position: #161 / 246
  • Number of attempts: 5
Paragraph breaks - 497 entries

Swap the blank lines and the aaa lines.

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

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 33
  • Position: #156 / 181
  • Number of attempts: 1
Collect List - 4203 entries

Convert to comma separated list.

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

add a prefix on some camelCase variables

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

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 18
  • Position: #225 / 436
  • Number of attempts: 2
Mute the second method of this script - 444 entries

prepend a # infront of every line of the second method

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

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2015 / 4124
  • Number of attempts: 2
-a-b-c- - 3129 entries

Put hyphens everywhere.

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

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #270 / 344
  • Number of attempts: 2
Gray area - 712 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 17
  • Position: #256 / 264
  • 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 ! - 10560 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1592 / 3645
  • Number of attempts: 2
Letter case trickery - 1563 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 / 503
  • Number of attempts: 4
Words in parens - 12775 entries

We should all ace this, right?

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

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

  • Best score: 18
  • Best player score: 27
  • Position: #573 / 751
  • Number of attempts: 3
Case preserving word replacement - 442 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 / 177
  • Number of attempts: 3
Insert a Markdown link - 422 entries

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

  • Best score: 22
  • Best player score: 27
  • Position: #105 / 142
  • Number of attempts: 2
Numbering a List - 1838 entries

Pretty simple, number the list.

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

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #363 / 440
  • Number of attempts: 2
Remember FizzBuzz? - 597 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 59
  • Position: #93 / 168
  • Number of attempts: 1
Change the content of a string - 1393 entries

This docstring is a complete lie. Fix it.

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

entered into 60 challenges

contributed 0 challenges