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

Insert column data on Confluence-style table - 417 entries

Add ip addresses into new "IP" column based on the last digits from the "Server" column

  • Best score: 33
  • Best player score: 46
  • Position: #45 / 96
  • Number of attempts: 4
Surround the 'z' character with brackets, quotes, and print as formatted string. - 465 entries

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

  • Best score: 17
  • Best player score: 18
  • Position: #196 / 256
  • Number of attempts: 1
Easier Align - 291 entries

Align the columns of a markdown table

  • Best score: 57
  • Best player score: 212
  • Position: #50 / 85
  • Number of attempts: 1
Paste a column after a column - 2171 entries

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

  • Best score: 14
  • Best player score: 22
  • Position: #283 / 465
  • Number of attempts: 2
Filter number combinations that don't add to 11 - 357 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: 31
  • Position: #89 / 106
  • Number of attempts: 3
Tabbed Table to Python Array - 608 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: 64
  • Position: #101 / 160
  • Number of attempts: 3
HS exam question - 1469 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 64
  • Position: #141 / 389
  • Number of attempts: 2
Reformat symbols in list - 1447 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #84 / 318
  • Number of attempts: 5
Fizzbuzz - 489 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 89
  • Position: #106 / 153
  • Number of attempts: 2
Substraction (bis) - 559 entries

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

  • Best score: 21
  • Best player score: 34
  • Position: #71 / 105
  • Number of attempts: 1
Changing around text with citations - 302 entries

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 39
  • Position: #47 / 85
  • Number of attempts: 2
Poorly indented Python comments - 1149 entries

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

  • Best score: 15
  • Best player score: 43
  • Position: #143 / 199
  • Number of attempts: 1
Many duplicates - 1218 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #213 / 397
  • Number of attempts: 3
2 quick changes and a numbered list - 580 entries

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

  • Best score: 37
  • Best player score: 46
  • Position: #77 / 141
  • Number of attempts: 2
delete swap - 1466 entries

delete all swap

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

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

  • Best score: 29
  • Best player score: 62
  • Position: #214 / 244
  • Number of attempts: 2
Put a newline after every 10 lines in vim - 1554 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #234 / 518
  • Number of attempts: 1
Wikitext headings to markdown - 962 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 36
  • Position: #145 / 199
  • Number of attempts: 1
hello-world-vimgolf - 2311 entries

Simple number generation

  • Best score: 10
  • Best player score: 14
  • Position: #473 / 653
  • Number of attempts: 1
Fill in the chess board - 886 entries

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

  • Best score: 19
  • Best player score: 37
  • Position: #93 / 173
  • Number of attempts: 3
Learn to ask for :help - 510 entries

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

  • Best score: 19
  • Best player score: 34
  • Position: #73 / 118
  • Number of attempts: 2
Plotting some variables in python - 1549 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: 55
  • Position: #220 / 330
  • Number of attempts: 3
Transpose a python matrix - 823 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 57
  • Position: #85 / 132
  • Number of attempts: 2
Create a diamond comment - 301 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 55
  • Position: #53 / 70
  • Number of attempts: 2
Lowercase first characters - 458 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: 57
  • Position: #154 / 172
  • Number of attempts: 1
Make list of numbers from 1 to 30 more compact, but more confusing - 87 entries

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

  • Best score: 74
  • Best player score: 162
  • Position: #29 / 35
  • Number of attempts: 2
Inverting Lines - 1797 entries

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

  • Best score: 10
  • Best player score: 14
  • Position: #348 / 486
  • Number of attempts: 1
C to python code snippet - 78 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: 102
  • Position: #24 / 27
  • Number of attempts: 1
Rural Post - 4352 entries

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

  • Best score: 9
  • Best player score: 14
  • Position: #646 / 1066
  • Number of attempts: 3
Multiline to Single Line - 596 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #71 / 268
  • Number of attempts: 1
From a Thunderlink to a Markdown link - 738 entries

ThunderLinks are durable hyperlinks to specific email messages generated from Thunderbird in HTML format. Leverage the power of vim to make them suitable for a markdown-formatted file.

  • Best score: 18
  • Best player score: 20
  • Position: #75 / 165
  • Number of attempts: 2
Yo To Hello - 1107 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 11
  • Position: #411 / 512
  • Number of attempts: 1
Simple, Practical, and Common - 33354 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: 34
  • Position: #6386 / 7358
  • Number of attempts: 1
prepend * to every non-blank line - 6202 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 16
  • Position: #1035 / 1514
  • Number of attempts: 2
Quote modules - 1046 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 28
  • Position: #185 / 272
  • Number of attempts: 1
V to the i - 4743 entries

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

  • Best score: 7
  • Best player score: 9
  • Position: #1725 / 1878
  • Number of attempts: 2
Applying same text modification in several lines - 2845 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 16
  • Position: #605 / 840
  • Number of attempts: 2
Wrap the text of an email message to 79 characters - 676 entries

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

  • Best score: 5
  • Best player score: 17
  • Position: #375 / 384
  • Number of attempts: 1
Copy three lines - 2839 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 20
  • Position: #419 / 634
  • Number of attempts: 2
Search and Replace 0 - 4790 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Position: #677 / 1585
  • Number of attempts: 4
Python Hello World! Reformatting - 936 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 44
  • Position: #241 / 363
  • Number of attempts: 1
Basic renumbering - 5584 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 26
  • Position: #1171 / 1257
  • Number of attempts: 2
mp3 - Cutlist - 29 entries

An audio CD was accidentally ripped into one single mp3 file. A dummy cue-file now needs to be filled out with the correct values to get single mp3 files.

  • Best score: 65
  • Best player score: 139
  • Position: #8 / 12
  • Number of attempts: 2
Reorder the groups - 1137 entries

Change the order so that the groups of fruit come before the vegetables.

  • Best score: 14
  • Best player score: 24
  • Position: #208 / 259
  • Number of attempts: 3
The meaning - 554 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #312 / 355
  • Number of attempts: 1
Ugly spreadsheet copy/paste to CSV - 973 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 48
  • Position: #139 / 185
  • Number of attempts: 2
Overall Vimgolf Rank - 170 entries

Suppose you are trying to figure out what your overall rank is at Vimgolf(the sum of all the ranks you got), and as a Vim ninja you decided to use Vim to do the job. Your solution should work for every Vimgolf profile page(The actual input file for this challenge is my Vimgolf profile page). So, direct answer insertion is considered cheating.

  • Best score: 23
  • Best player score: 42
  • Position: #43 / 57
  • Number of attempts: 1
Letters are numbers - 150 entries

Letters and numbers are interchangeable. A lot of programming languages give you simple ways to convert individual letters to hex, binary and decimal but does Vim?

  • Best score: 20
  • Best player score: 39
  • Position: #70 / 73
  • Number of attempts: 2
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #450 / 511
  • Number of attempts: 1
Reformat most common surnames - 644 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 49
  • Position: #177 / 197
  • Number of attempts: 1
Get rid of html tags - 368 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 15
  • Best player score: 17
  • Position: #115 / 217
  • Number of attempts: 2
Change the content of a string - 1457 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #465 / 552
  • Number of attempts: 1
Sort and add attributes - 1321 entries

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

  • Best score: 33
  • Best player score: 39
  • Position: #476 / 527
  • Number of attempts: 2
Flodder-challenge - 1089 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 39
  • Position: #221 / 306
  • Number of attempts: 1
Simple text editing with Vim - 12233 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1893 / 3567
  • Number of attempts: 4
Sergio
Twitter:

entered into 55 challenges

contributed 0 challenges