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 - 721 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: #72 / 178
  • Number of attempts: 2
Reformat symbols in list - 1607 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #128 / 345
  • Number of attempts: 10
Fizzbuzz - 557 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 45
  • Best player score: 59
  • Position: #40 / 166
  • Number of attempts: 7
Many duplicates - 1443 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #152 / 467
  • Number of attempts: 4
delete swap - 1773 entries

delete all swap

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

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 31
  • Position: #264 / 589
  • Number of attempts: 5
Wikitext headings to markdown - 987 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 26
  • Position: #114 / 209
  • Number of attempts: 6
hello-world-vimgolf - 2494 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #42 / 270
  • Number of attempts: 4
Fill in the chess board - 956 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: #115 / 183
  • Number of attempts: 1
Plotting some variables in python - 1660 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 / 347
  • Number of attempts: 9
Lowercase first characters - 487 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 / 183
  • Number of attempts: 3
Migrated to Postgres! - 323 entries

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

  • Best score: 26
  • Best player score: 29
  • Position: #61 / 126
  • Number of attempts: 3
Increment number for every 10 lines - 229 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: #51 / 63
  • Number of attempts: 3
simple replacements - 1753 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #131 / 380
  • Number of attempts: 8
Inverting Lines - 1882 entries

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

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

Simple challenge to extract fields from a Python class

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 51
  • Position: #231 / 319
  • Number of attempts: 2
swap number pairs - 2066 entries

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

  • Best score: 16
  • Best player score: 26
  • Position: #195 / 377
  • Number of attempts: 6
HS Final exam vimgolf - 897 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: #167 / 236
  • Number of attempts: 3
Easy modification of ssh config - 360 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 38
  • Position: #79 / 111
  • Number of attempts: 1
Add quotes to ansible playbook - 952 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #191 / 304
  • Number of attempts: 3
Simple, Practical, and Common - 33591 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 / 7410
  • Number of attempts: 5
One number per line - 18711 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2308 / 3858
  • Number of attempts: 4
V to the i - 4798 entries

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

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

Change Typescript enum so that it has string initializers.

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

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #523 / 703
  • Number of attempts: 4
Extract argument from function - 2355 entries

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

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

"vim vi improved"

  • Best score: 9
  • Best player score: 18
  • Position: #650 / 701
  • Number of attempts: 1
Interweave two blocks of text - 659 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 / 214
  • Number of attempts: 3
Basic renumbering - 5645 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #265 / 1263
  • Number of attempts: 3
Add to end of each line... kinda - 333 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: #173 / 174
  • 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 - 1420 entries

How can you reuse a previous substitution ?

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

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #607 / 2125
  • Number of attempts: 5
Free hyphen! - 169 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 / 89
  • Number of attempts: 4
Order and join - 983 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 12
  • Position: #172 / 259
  • Number of attempts: 5
Paragraph breaks - 522 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 11
  • Position: #87 / 167
  • Number of attempts: 5
Scrambled numbers - 807 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 33
  • Position: #159 / 184
  • Number of attempts: 1
Collect List - 4298 entries

Convert to comma separated list.

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

Put 3 spaces between adjacent letters.

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

prepend a # infront of every line of the second method

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

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2031 / 4175
  • Number of attempts: 2
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #310 / 1137
  • 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 - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 17
  • Position: #262 / 271
  • Number of attempts: 1
Split the words - 357 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: #103 / 109
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10657 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1591 / 3679
  • Number of attempts: 2
Letter case trickery - 1624 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 / 517
  • Number of attempts: 4
Words in parens - 12928 entries

We should all ace this, right?

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

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

  • Best score: 18
  • Best player score: 27
  • Position: #591 / 776
  • Number of attempts: 3
Case preserving word replacement - 454 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 / 180
  • Number of attempts: 3
Insert a Markdown link - 434 entries

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

  • Best score: 22
  • Best player score: 27
  • Position: #108 / 145
  • Number of attempts: 2
Numbering a List - 1931 entries

Pretty simple, number the list.

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

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #367 / 458
  • Number of attempts: 2
Remember FizzBuzz? - 713 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 59
  • Position: #106 / 188
  • Number of attempts: 1
Change the content of a string - 1561 entries

This docstring is a complete lie. Fix it.

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

entered into 60 challenges

contributed 0 challenges