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 - 411 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: #44 / 93
  • Number of attempts: 4
Surround the 'z' character with brackets, quotes, and print as formatted string. - 445 entries

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

  • Best score: 17
  • Best player score: 18
  • Position: #187 / 245
  • Number of attempts: 1
Easier Align - 257 entries

Align the columns of a markdown table

  • Best score: 57
  • Best player score: 212
  • Position: #47 / 81
  • Number of attempts: 1
Paste a column after a column - 2093 entries

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

  • Best score: 14
  • Best player score: 22
  • Position: #273 / 449
  • Number of attempts: 2
Filter number combinations that don't add to 11 - 341 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: #87 / 102
  • Number of attempts: 3
Tabbed Table to Python Array - 602 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: #99 / 157
  • Number of attempts: 3
HS exam question - 1410 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 64
  • Position: #138 / 380
  • Number of attempts: 2
Reformat symbols in list - 1390 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #83 / 308
  • Number of attempts: 5
Fizzbuzz - 485 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 89
  • Position: #105 / 151
  • Number of attempts: 2
Substraction (bis) - 534 entries

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

  • Best score: 21
  • Best player score: 34
  • Position: #68 / 102
  • Number of attempts: 1
Changing around text with citations - 300 entries

Based off of something I saw on reddit

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

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

  • Best score: 15
  • Best player score: 43
  • Position: #141 / 196
  • Number of attempts: 1
Many duplicates - 1184 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #212 / 385
  • Number of attempts: 3
2 quick changes and a numbered list - 563 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: #75 / 136
  • Number of attempts: 2
delete swap - 1440 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #228 / 457
  • Number of attempts: 1
Generate a very basic Python constructor (fixed) - 1152 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: #212 / 242
  • Number of attempts: 2
Put a newline after every 10 lines in vim - 1543 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #231 / 515
  • Number of attempts: 1
Wikitext headings to markdown - 939 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 36
  • Position: #143 / 196
  • Number of attempts: 1
hello-world-vimgolf - 2287 entries

Simple number generation

  • Best score: 10
  • Best player score: 14
  • Position: #467 / 645
  • 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 - 507 entries

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

  • Best score: 19
  • Best player score: 34
  • Position: #73 / 116
  • Number of attempts: 2
Plotting some variables in python - 1531 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: #216 / 326
  • 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 - 455 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: #153 / 170
  • 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 - 1772 entries

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

  • Best score: 10
  • Best player score: 14
  • Position: #342 / 479
  • 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 - 4342 entries

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

  • Best score: 9
  • Best player score: 14
  • Position: #643 / 1062
  • Number of attempts: 3
Multiline to Single Line - 594 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #71 / 266
  • 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 - 1103 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 11
  • Position: #408 / 509
  • Number of attempts: 1
Simple, Practical, and Common - 33342 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: #6383 / 7355
  • Number of attempts: 1
prepend * to every non-blank line - 6191 entries

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

  • Best score: 10
  • Best player score: 16
  • Position: #1033 / 1512
  • Number of attempts: 2
Quote modules - 1041 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 28
  • Position: #183 / 270
  • 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 - 671 entries

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

  • Best score: 5
  • Best player score: 17
  • Position: #374 / 382
  • Number of attempts: 1
Copy three lines - 2836 entries

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

  • Best score: 13
  • Best player score: 20
  • Position: #418 / 633
  • Number of attempts: 2
Search and Replace 0 - 4785 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #677 / 1584
  • Number of attempts: 4
Python Hello World! Reformatting - 933 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: #240 / 362
  • Number of attempts: 1
Basic renumbering - 5576 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 26
  • Position: #1169 / 1255
  • 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 - 1129 entries

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

  • Best score: 14
  • Best player score: 24
  • Position: #207 / 258
  • Number of attempts: 3
The meaning - 552 entries

Numbers are fun!

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

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

  • Best score: 19
  • Best player score: 48
  • Position: #138 / 184
  • Number of attempts: 2
Overall Vimgolf Rank - 163 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: #42 / 57
  • Number of attempts: 1
Letters are numbers - 149 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 - 1283 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 - 640 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 - 1453 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #464 / 550
  • Number of attempts: 1
Sort and add attributes - 1314 entries

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

  • Best score: 33
  • Best player score: 39
  • Position: #474 / 524
  • Number of attempts: 2
Flodder-challenge - 1074 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 39
  • Position: #219 / 304
  • Number of attempts: 1
Simple text editing with Vim - 12203 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 / 3559
  • Number of attempts: 4
Sergio
Twitter:

entered into 55 challenges

contributed 0 challenges