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

Replace word while reserving first letter case - 604 entries

Window -> Door window -> door Windows -> Windows windows -> windows

  • Best score: 24
  • Best player score: 33
  • Position: #56 / 118
  • Number of attempts: 3
months to html list items - 1008 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 24
  • Position: #69 / 274
  • Number of attempts: 3
Quicksort - 1945 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 24
  • Position: #230 / 429
  • Number of attempts: 1
Populate 3D bone names list - 629 entries

Ran into this at work, excited to see how this gets optimized

  • Best score: 21
  • Best player score: 25
  • Position: #55 / 162
  • Number of attempts: 4
Find fix point of cos - 1395 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 14
  • Position: #34 / 410
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 554 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #135 / 309
  • Number of attempts: 2
Easier Align - 406 entries

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 233
  • Position: #62 / 96
  • Number of attempts: 1
Tabbed Table to Python Array - 734 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: 53
  • Position: #31 / 179
  • Number of attempts: 13
HS exam question - 1578 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 48
  • Position: #33 / 416
  • Number of attempts: 13
Reformat symbols in list - 1614 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #146 / 347
  • Number of attempts: 8
Fizzbuzz - 557 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 45
  • Best player score: 57
  • Position: #36 / 166
  • Number of attempts: 5
Many duplicates - 1445 entries

Quick and easy

  • Best score: 7
  • Best player score: 7
  • Position: #18 / 468
  • Number of attempts: 4
2 quick changes and a numbered list - 647 entries

The ascii will not be lost, but rather numbered in 4 digit blocks with leading zeros.

  • Best score: 37
  • Best player score: 41
  • Position: #54 / 154
  • Number of attempts: 8
delete swap - 1776 entries

delete all swap

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

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 29
  • Position: #198 / 589
  • Number of attempts: 4
Visual block training - 1070 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 18
  • Position: #33 / 204
  • Number of attempts: 10
Put a newline after every 10 lines in vim - 1657 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 11
  • Position: #158 / 556
  • Number of attempts: 3
hello-world-vimgolf - 2499 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #242 / 708
  • Number of attempts: 4
Contribute to keyboard mashing - 890 entries

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #46 / 270
  • Number of attempts: 5
Solve anagram with ASCII letters - 54 entries

ASCII created by TOIlet command

  • Best score: 46
  • Best player score: 73
  • Position: #11 / 18
  • Number of attempts: 1
Fill in the chess board - 959 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #27 / 185
  • Number of attempts: 16
Transpose a python matrix - 873 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 39
  • Position: #64 / 138
  • Number of attempts: 3
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: 51
  • Position: #152 / 183
  • Number of attempts: 2
Making 3 line function a one liner. - 328 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #120 / 205
  • Number of attempts: 1
Modernise code - 1400 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #62 / 323
  • Number of attempts: 6
Enumerate Bullets - 320 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

  • Best score: 20
  • Best player score: 24
  • Position: #43 / 84
  • Number of attempts: 4
Put a cross in the square - 225 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 21
  • Position: #17 / 89
  • Number of attempts: 3
swap number pairs - 2103 entries

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

  • Best score: 16
  • Best player score: 25
  • Position: #188 / 380
  • Number of attempts: 4
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: 21
  • Position: #31 / 236
  • Number of attempts: 6
Extend shell script - 134 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 68
  • Position: #33 / 45
  • Number of attempts: 1
Easy modification of ssh config - 371 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 25
  • Position: #34 / 112
  • Number of attempts: 5
ssh config skills - 256 entries

Parse output from `kuebctl get no -o wide` into an .ssh/config file!

  • Best score: 41
  • Best player score: 75
  • Position: #47 / 65
  • Number of attempts: 2
Change double quotes to single quotes, but with a twist - 309 entries

Although this challenge is in the context of a Python function, you don't need to know Python to do this challenge. It is to add contexts and interesting constraints. The file contains a function that prints a multi-line string literal. I wrote the string literal with double quotes, but then I decided to use single quotes instead, and that's your challenge. However, interestingly enough, the string itself contains single and double quotes. This means, inside the string literal, the originally escaped double quotes no longer need to be escaped, but the single quotes now need to be escaped. Note that the triple double quotes in the docstring should be left alone.

  • Best score: 22
  • Best player score: 34
  • Position: #35 / 56
  • Number of attempts: 5
C to python code snippet - 88 entries

C code can be easily translated into Python code. However, the difference in syntax can make this process tedious and time-consuming. Can Vim help you here?

  • Best score: 48
  • Best player score: 80
  • Position: #23 / 30
  • Number of attempts: 1
Mr. Hacker - 89 entries

Elvin is hacker. He has piece of users database from some social net site. Recently he installed Vim, and he wants to convert CSV DB to specific format `key=value' where `key' is login and `value' is password, but password in DB is encrypted in ROT13. Help him.

  • Best score: 19
  • Best player score: 19
  • Position: #14 / 35
  • Number of attempts: 4
Python: Def to Lambda - 455 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #78 / 156
  • Number of attempts: 4
Turn the x - 328 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 20
  • Position: #36 / 82
  • Number of attempts: 7
Format the CSS - 157 entries

You just copied some CSS color names from the web and need to add them to your python module. Create the COLORS variable and assign a dict() with the names as keys and hex-colors as values. BEWARE OF THE TABS!!

  • Best score: 41
  • Best player score: 41
  • Position: #4 / 48
  • Number of attempts: 7
Rural Post - 4479 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 10
  • Position: #462 / 1097
  • Number of attempts: 3
Levenshtein distance - 105 entries

Compute distance for each pair. Notice that this recursive implementation is very inefficient. Wagner-Fischer algorithm is iterative and much faster. #vimscript

  • Best score: 27
  • Best player score: 44
  • Position: #34 / 37
  • Number of attempts: 1
Satisfy the go linter - 2391 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 20
  • Position: #144 / 471
  • Number of attempts: 5
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: 8
  • Position: #85 / 304
  • Number of attempts: 4
Multiline to Single Line - 700 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #215 / 302
  • Number of attempts: 2
xrandr outputs and dashes - 704 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 12
  • Position: #136 / 221
  • Number of attempts: 4
VimGolfNight - 560 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #287 / 347
  • Number of attempts: 4
Line 'em up! - 421 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 17
  • Position: #38 / 114
  • Number of attempts: 11
Custom McCarthy sequence - 44 entries

Generate the first one hundred and twenty numbers (starting with n=1). See here for some inspiration: http://en.wikipedia.org/wiki/McCarthy_91_function

  • Best score: 15
  • Best player score: 20
  • Position: #14 / 17
  • Number of attempts: 3
Counting in binary - 526 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

  • Best score: 16
  • Best player score: 52
  • Position: #102 / 117
  • Number of attempts: 1
quotes inside quotes - 3159 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 15
  • Position: #510 / 1078
  • Number of attempts: 4
Marco Meinardi
Twitter:

entered into 49 challenges

contributed 0 challenges