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]

44656 active golfers, 505574 entries, 619 challenges

Open VimGolf challenges

String decompression - 43 entries

3a4b2c => aaabbbbcc. Start a new line when you exceed 79 columns.

Reverse even lines - 44 entries

Reverse only the even lines without altering the odd lines.

Format a long line - 129 entries

Reformat long lines (gq), textwidth=78, no trailing spaces.

Evil Numbers - 117 entries

Print the first 100 evil numbers https://oeis.org/A001969. This is an advert for code.golf https://code.golf/evil-numbers#viml

Mirror image - 126 entries

Add the second eye

Find anomalies - 166 entries

There is one special character per line

Coordinate extraction - 67 entries

Get the coordinates of all "M"s from the Vim logo

Morse - 181 entries

Translate Morse code to Text

New teacher - 1506 entries

Update the details of the new CS teacher.

Truth Table to ModelSim - 66 entries

Convert this truth table to simulator instructions!

Replace word while reserving first letter case - 665 entries

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

months to html list items - 1139 entries

Turn the months into list items.

Instance creation in Verilog - 48 entries

Creating an instance of a module is a very frequent task in Verilog. Let's see how efficiently can it be done

Quicksort - 2109 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.

EDN reformat - 1218 entries

The goal is to make the code more readable and concise while maintaining its functionality.

Tic-Tac-Toe Grid Transformation - 450 entries

Your mission is to efficiently convert the original Tic-Tac-Toe grid, represented by 'x's and 'o's, into a neat and well-organized game board.

Pick and sort servers from mirror list - 463 entries

Retrieve the primary server for each country from a mirror list file and organize them alphabetically by country name. Given a mirror list file containing server information for various countries, the objective is to extract the primary server from each country and then arrange these servers in alphabetical order based on the respective country names.

Populate 3D bone names list - 656 entries

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

Remove line numbers - 784 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

Find fix point of cos - 1485 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.

Insert column data on Confluence-style table - 503 entries

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

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

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

Easier Align - 443 entries

Align the columns of a markdown table

Paste a column after a column - 2668 entries

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

Filter number combinations that don't add to 11 - 427 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.

Tabbed Table to Python Array - 773 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

HS exam question - 1613 entries

Convert the data to a python dictionary

Reformat symbols in list - 1656 entries

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

Fizzbuzz - 614 entries

type the first 100 lines of the fizzbuzz problem

Substraction (bis) - 638 entries

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

Changing around text with citations - 362 entries

Based off of something I saw on reddit

Poorly indented Python comments - 1350 entries

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

Many duplicates - 1483 entries

Quick and easy

2 quick changes and a numbered list - 661 entries

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

delete swap - 1883 entries

delete all swap

Generate a very basic Python constructor (fixed) - 1295 entries

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

Fix the shell script! - 2681 entries

Fix the shell script with the fewest keystrokes!

Visual block training - 1118 entries

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

Innocent Monster - 230 entries

You have the tools, just create him!

Put a newline after every 10 lines in vim - 1688 entries

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

Java to JavaScript - 302 entries

Let convert some simple Java file to JavaScript!

Wikitext headings to markdown - 1035 entries

Convert the wikitext headings to markdown.

hello-world-vimgolf - 2533 entries

Simple number generation

Contribute to keyboard mashing - 908 entries

Speak in tongues

Reordering Lorem Ipsum - 306 entries

Who even sorted this?

Solve anagram with ASCII letters - 63 entries

ASCII created by TOIlet command

Fill in the chess board - 980 entries

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

Learn to ask for :help - 596 entries

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

Plotting some variables in python - 1691 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.

Transpose a python matrix - 905 entries

Rotate the matrix in 90 degrees.

VimGolf Chatter