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

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

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

  • Best score: 17
  • Best player score: 17
  • Position: #84 / 324
  • Number of attempts: 1
Easier Align - 442 entries

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 62
  • Position: #14 / 99
  • Number of attempts: 2
Paste a column after a column - 2662 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 14
  • Position: #45 / 576
  • Number of attempts: 1
Filter number combinations that don't add to 11 - 424 entries

Append the sum of each line to its end, alongside an equals sign, and remove any that do not sum to 11. The ordering of lines should stay the same. Note that the combinations are semi-arbitrary and not all 4-number combinations are present in the file.

  • Best score: 27
  • Best player score: 28
  • Position: #66 / 122
  • Number of attempts: 1
HS exam question - 1610 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 47
  • Position: #11 / 420
  • Number of attempts: 16
Reformat symbols in list - 1649 entries

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

  • Best score: 24
  • Best player score: 24
  • Position: #24 / 355
  • Number of attempts: 5
Fizzbuzz - 612 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 44
  • Best player score: 47
  • Position: #16 / 171
  • Number of attempts: 1
Substraction (bis) - 637 entries

Solve the equations (adapted from the original @Caek_'s challenge).

  • Best score: 21
  • Best player score: 22
  • Position: #18 / 116
  • Number of attempts: 13
Changing around text with citations - 361 entries

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 28
  • Position: #15 / 95
  • Number of attempts: 7
Poorly indented Python comments - 1348 entries

Fix the alignment of some Python comments as quickly as possible.

  • Best score: 15
  • Best player score: 15
  • Position: #27 / 224
  • Number of attempts: 2
Many duplicates - 1472 entries

Quick and easy

  • Best score: 7
  • Best player score: 7
  • Position: #15 / 480
  • Number of attempts: 2
2 quick changes and a numbered list - 660 entries

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

  • Best score: 37
  • Best player score: 37
  • Position: #18 / 156
  • Number of attempts: 2
delete swap - 1834 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #147 / 570
  • Number of attempts: 1
Generate a very basic Python constructor (fixed) - 1294 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 29
  • Position: #39 / 277
  • Number of attempts: 6
Fix the shell script! - 2663 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 26
  • Position: #37 / 619
  • Number of attempts: 3
Visual block training - 1116 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #5 / 208
  • Number of attempts: 2
Put a newline after every 10 lines in vim - 1680 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #180 / 564
  • Number of attempts: 4
Java to JavaScript - 299 entries

Let convert some simple Java file to JavaScript!

  • Best score: 59
  • Best player score: 59
  • Position: #9 / 77
  • Number of attempts: 1
Wikitext headings to markdown - 1029 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 20
  • Position: #38 / 213
  • Number of attempts: 1
hello-world-vimgolf - 2523 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #44 / 274
  • Number of attempts: 1
Reordering Lorem Ipsum - 306 entries

Who even sorted this?

  • Best score: 13
  • Best player score: 13
  • Position: #18 / 67
  • Number of attempts: 1
Solve anagram with ASCII letters - 63 entries

ASCII created by TOIlet command

  • Best score: 46
  • Best player score: 48
  • Position: #8 / 19
  • Number of attempts: 1
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: 19
  • Position: #26 / 186
  • Number of attempts: 1
Learn to ask for :help - 593 entries

Learn to use the help to reduce your strokes...

  • Best score: 19
  • Best player score: 21
  • Position: #21 / 131
  • Number of attempts: 4
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: #45 / 352
  • Number of attempts: 1
Transpose a python matrix - 901 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 23
  • Position: #16 / 139
  • Number of attempts: 1
Create a diamond comment - 355 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 27
  • Position: #10 / 76
  • Number of attempts: 1
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: #28 / 185
  • Number of attempts: 1
Make list of numbers from 1 to 30 more compact, but more confusing - 124 entries

Change the naming logic of numbers to end up with less lines.

  • Best score: 74
  • Best player score: 75
  • Position: #5 / 40
  • Number of attempts: 1
Migrated to Postgres! - 348 entries

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

  • Best score: 26
  • Best player score: 26
  • Position: #11 / 134
  • Number of attempts: 5
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: 25
  • Position: #5 / 66
  • Number of attempts: 1
simple replacements - 1861 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 19
  • Position: #66 / 399
  • Number of attempts: 1
Inverting Lines - 1952 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #178 / 522
  • Number of attempts: 1
CSV to MD format - 448 entries

To convert a CSV list to Markdown list

  • Best score: 36
  • Best player score: 36
  • Position: #11 / 98
  • Number of attempts: 1
Python dataclasses - 1248 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 19
  • Position: #57 / 311
  • Number of attempts: 1
Count to 100 in word form - 158 entries

Write all the numbers from 1 to 100, using their word forms rather than the digit form. Most of the parts you will need are included in the input file. Use hyphens when appropriate.

  • Best score: 53
  • Best player score: 55
  • Position: #8 / 32
  • Number of attempts: 2
RUST Cargo.toml version to last - 394 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

  • Best score: 16
  • Best player score: 16
  • Position: #23 / 105
  • Number of attempts: 1
Making 3 line function a one liner. - 343 entries

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #55 / 331
  • Number of attempts: 1
Enumerate Bullets - 337 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: 18
  • Best player score: 20
  • Position: #25 / 91
  • Number of attempts: 2
Put a cross in the square - 243 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 20
  • Position: #11 / 93
  • Number of attempts: 7
swap number pairs - 2168 entries

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

  • Best score: 16
  • Best player score: 23
  • Position: #180 / 392
  • Number of attempts: 3
Extend shell script - 155 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 37
  • Position: #6 / 49
  • Number of attempts: 1
ssh config skills - 278 entries

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

  • Best score: 41
  • Best player score: 41
  • Position: #12 / 67
  • Number of attempts: 1
Change double quotes to single quotes, but with a twist - 338 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: 22
  • Position: #21 / 59
  • Number of attempts: 2
C to python code snippet - 101 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: 49
  • Position: #9 / 31
  • Number of attempts: 1
Turn the x - 339 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 19
  • Position: #19 / 84
  • Number of attempts: 1
Format the CSS - 165 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: 42
  • Position: #13 / 50
  • Number of attempts: 1
Rural Post - 4579 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #197 / 1117
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 852 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #290 / 441
  • Number of attempts: 1
C Reformatting - 692 entries

You may use Visual mode... or not. #uppercase

  • Best score: 30
  • Best player score: 30
  • Position: #23 / 164
  • Number of attempts: 1
Add links to an existing HTML table - 97 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

  • Best score: 42
  • Best player score: 42
  • Position: #3 / 31
  • Number of attempts: 12
Remove semicolons after expressions - 669 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #129 / 265
  • Number of attempts: 1
Generate Fibonacci Numbers - 300 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 19
  • Position: #22 / 106
  • Number of attempts: 1
Sort and add attributes - 1557 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 33
  • Position: #258 / 601
  • Number of attempts: 2
Add fold markers to a .c file - 690 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 30
  • Best player score: 35
  • Position: #107 / 197
  • Number of attempts: 3
Reconstruct the Sentence - 1697 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 20
  • Position: #138 / 445
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3949 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 17
  • Position: #169 / 841
  • Number of attempts: 1
Simple text editing with Vim - 13419 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #1995 / 3846
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 7506 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 7
  • Best player score: 34
  • Position: #323 / 1846
  • Number of attempts: 2
Topvimgolf Score
Twitter:

Working through Vimgolf example till the top or second top score, to be able to see all of the solutions, and practice them.

entered into 61 challenges

contributed 0 challenges