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 - 564 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: #59 / 150
  • Number of attempts: 2
Reformat symbols in list - 1321 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #107 / 294
  • Number of attempts: 10
Fizzbuzz - 464 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 59
  • Position: #36 / 144
  • Number of attempts: 7
Many duplicates - 1123 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #143 / 364
  • Number of attempts: 4
delete swap - 1378 entries

delete all swap

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

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 31
  • Position: #219 / 472
  • Number of attempts: 5
Wikitext headings to markdown - 905 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 26
  • Position: #104 / 189
  • Number of attempts: 6
hello-world-vimgolf - 2185 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #42 / 243
  • Number of attempts: 4
Fill in the chess board - 843 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: #107 / 169
  • Number of attempts: 1
Plotting some variables in python - 1505 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 / 317
  • Number of attempts: 9
Lowercase first characters - 450 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 / 166
  • Number of attempts: 3
Migrated to Postgres! - 287 entries

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

  • Best score: 26
  • Best player score: 29
  • Position: #59 / 114
  • Number of attempts: 3
Increment number for every 10 lines - 212 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: #46 / 58
  • Number of attempts: 3
simple replacements - 1371 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #115 / 307
  • Number of attempts: 8
Inverting Lines - 1679 entries

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

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

Simple challenge to extract fields from a Python class

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 51
  • Position: #215 / 297
  • Number of attempts: 2
swap number pairs - 1945 entries

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

  • Best score: 16
  • Best player score: 26
  • Position: #187 / 359
  • Number of attempts: 6
HS Final exam vimgolf - 852 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: #157 / 224
  • 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 - 858 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #185 / 272
  • Number of attempts: 3
Simple, Practical, and Common - 33256 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 / 7337
  • Number of attempts: 5
One number per line - 18574 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2294 / 3834
  • Number of attempts: 4
V to the i - 4717 entries

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

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

Change Typescript enum so that it has string initializers.

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

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #520 / 698
  • Number of attempts: 4
Extract argument from function - 2292 entries

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

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

"vim vi improved"

  • Best score: 9
  • Best player score: 18
  • Position: #642 / 691
  • Number of attempts: 1
Interweave two blocks of text - 615 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 / 210
  • Number of attempts: 3
Basic renumbering - 5521 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #265 / 1251
  • Number of attempts: 3
Add to end of each line... kinda - 316 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: #165 / 166
  • Number of attempts: 1
Combines all items - 302 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 / 136
  • Number of attempts: 5
ninja substitution - 1368 entries

How can you reuse a previous substitution ?

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

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #607 / 2084
  • 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 - 924 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 12
  • Position: #165 / 251
  • Number of attempts: 5
Paragraph breaks - 500 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 11
  • Position: #85 / 164
  • 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 - 4238 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #521 / 1180
  • 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 - 1610 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 18
  • Position: #226 / 438
  • 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 - 15890 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2024 / 4152
  • Number of attempts: 2
-a-b-c- - 3160 entries

Put hyphens everywhere.

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

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #272 / 348
  • Number of attempts: 2
Gray area - 720 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 17
  • Position: #258 / 266
  • 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 ! - 10595 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1591 / 3657
  • Number of attempts: 2
Letter case trickery - 1588 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 / 509
  • Number of attempts: 4
Words in parens - 12824 entries

We should all ace this, right?

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

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

  • Best score: 18
  • Best player score: 27
  • Position: #580 / 761
  • Number of attempts: 3
Case preserving word replacement - 444 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 / 178
  • Number of attempts: 3
Insert a Markdown link - 429 entries

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

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

Pretty simple, number the list.

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

You did the simple deletion, now reverse it.

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

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 59
  • Position: #96 / 173
  • Number of attempts: 1
Change the content of a string - 1442 entries

This docstring is a complete lie. Fix it.

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

entered into 60 challenges

contributed 0 challenges