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]

25917 active golfers, 293071 entries, 459 challenges

Open VimGolf challenges

SQL to YAML - 33 entries

Should be easy with vim, or not?

Permutations N=4 - 55 entries

Could use backtracking or other algorithm to generate sorted numbers. Second chance !

Hanging Indent for Footnotes - 58 entries

Format this footnote (in kramdown syntax) so that it has hanging indent.

Dumb to smart - 81 entries

Turn dumb quote to smart vim's way.

Create bison tokens - 34 entries

Create tokens for bison out of a known list of words

Circle of Fifths with Sharps - 61 entries

Display a list of the Circle of Fifths with corresponding solfege syllables with sharps. Handling spaces may be tricky.

Remove hard line breaks - 39 entries

Text files with Hard breaks are not good for e-readers. We need remove all hard line breaks and have long lines.

Here, piggy, piggy... - 75 entries

Youay owknay atwhay otay oday...

Binary and Increment - 41 entries

Some numbers fun: not only increasing numbers but also increasing binary.

Add links to an existing HTML table - 59 entries

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

Greek column realign - 40 entries

Oops one letter is missing! Shift down the second column to insert nu letter. Symbol can be entered using: <C-K>n*

Tiny column alignment - 37 entries

Align using the four blocks, don't forget to lowercase and have fun!

fib.c cleanup - 56 entries

cleanup the file

Return the cow - 71 entries

This cow is too verbose. Give it a lesson.

Recursive Cowsay - 49 entries

Convert 'cowsay' statement to recursive output

C to VimDict - 38 entries

Convert a C data structure to a Vimscript dictionary.

JSON string rotation - 38 entries

Right value strings are misplaced. Just rotate them! I'm too kind with you guys and didn't included "strings with \" in it"!

Coordinates placeholder - 52 entries

Place coordinates instead of target search.

Five Pillars - 43 entries

Arrange all words in a table with 5 columns. The minimal space between words in columns is 2 spaces. Columns do have varying width.

Chinese Multiplication Table - 50 entries

Print a Chinese multiplication table in Vim. In China, every kid is asked to memorize this table. And thanks to the mono-syllabism of Chinese characters, it is not that hard. Printing the multiplication table is also a good exercise for programming beginners. For-loop, escaped characters, etc... There should be some special ways to print it in Vim.

Greek Letters - 50 entries

Starting with a list of Greek letters, create a cross-reference table showing all of the Greek alpha-beta. You'll likely need to use digraphs (:help digraphs). Note that while most digraphs can be entered with either character first, lowercase sigma has two digraphs -- s* AND *s! Good luck!

Enharmonic Equivalents - 52 entries

Transform # and b to digraphs

Carriage return - 41 entries

I have some raw data from terminal output which uses carriege return for formatting. Carriage return sets the pointer to the first character on the line, and subsequent characters will overwrite what was there before. The challange is to simulate the terminal behaviour in vim. I'm kind of unsure if I should have skipped lines 9 and 15, since there might be some interesting solutions which are not that generic. Happy Golfing!

Untangle my tail, please! - 44 entries

You know, this words were playing to chase their tails and Oops! What happened? Now we have a complete mess, their tails are totally tangled, can you please help them to untangle their tails?

Convert regular pandoc footnotes to in-line notes - 51 entries

Pandoc extends markdown by allowing footnotes, which are usually represented with a footnote identifier followed later in the document by the footnote itself. But Pandoc also allows inline footnotes without identifiers. How many strokes does it take to convert regular footnotes to inline notes? (NB: I've had trouble figuring out whether text-width makes a difference to Vimgolf in comparing the input and output file. I finally tested this locally using the Vimgolf vimrc and did a "gq" on the entire buffer as the last step. Apologies if I'm making a newbie mistake. First time submitter.)

un-C-escape string - 53 entries

Convert escape sequences to characters

sort python functions and methods alphabetically - 13 entries

* sort functions in the python file alphabetically * sort functions within a Class alphabetically * sort Classes alphabetically

Merge blank lines and properly capitalize - 31 entries

Here you need complete 2 tasks: 1. Remove all unwanted continuous blank lines and leave only 1 blank line between paragraphs. 2. Properly capitalize the sentences.

Under the cupola - 41 entries

Taking some liberty about the name and plot of the Stephen King's famous novel (and TV series) to make this challenge. Are you able to recreate graphically the key phrase of the story? (I think is gonna be hard!)

range(10) digit rotation - 32 entries

This is a data generator challenge or some kind of gift..

Extended Customer 2 - 44 entries

Format the chars

Across-Down Flip - 42 entries

Do this instead of the Sunday crossword.

Sort by sum of numbers in a line(?) - 45 entries

The lines with the biggest sums need to be at the top. The sums are on the right, which makes life hard. Maybe you can find a feature that will do all the work for you...

Presidential Sorting - 45 entries

Given a nice CSV formatted arrangement of the Presidents of the United States, we need to print out an alphabetical list in pretty columns. Prove that vim can conquer this basic Excel task!

TAR archive pretty print - 12 entries

Will you use isk ?

maximun and minimun - 45 entries

Find the maximum and minimum of the rows.

mp3 - Cutlist - 12 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.

Fibonacci Triangles - 41 entries

Triangles

Simple Maths - 30 entries

Not much to say, discover by yourself!

Sort by your own sum - 42 entries

Same numbers as last time, but you'll have to add them yourself.

XML to JSON - 41 entries

Convert this xml file into json.

No naked if allowed! - 23 entries

House style forbids naked condition statements, comments should start with a space character and be on their own line. Good luck!

Maze path - 25 entries

Follow the given motions and mark your path with Xs. Attention: This maze is quite big (20x20), please set your terminal size to at least 82.

Change The Perspective - 36 entries

This is a go game recodes file(.sgf file, refer to http://www.red-bean.com/sgf/). It base on such a coordinate system: in vertical direction, is from top(farthest end) to bottom, mark as a,b,c,...,s(19*19 board); in horizontal direction, is from left to right, uses the same notations. For Example, the coordinate notation 'cq', is the position at the bottom-left corner(vertical coordinate first). The record is from one player's perspective. We need to change to another's, but we don't want to change coordinate system, let it keep top to bottom and left to right. so we have to change the coordinates, a <-> s, b <-> r,c <-> q, etc. the Position 'cq', as transformation, it will be 'qd'.

Lenny Spiral - 10 entries

Make one lenny into an infinite army of lennys.

Refactor to Helpers - 45 entries

This Rails partial is almost all template escapes. Put it into a helper, and refactor each case to methods so we can build out the controls for each. (I've converted to tabs - fighting with Vimgolf's default config shouldn't be part of the challenge.)

Sort with uniq OpenEmbedded package names - 26 entries

For each line take 4th dirname of path. For example: "alsa-utils", "gawk-3.1.5", ... But! But if previous result is "files", take 3rd dirname instead. For example: "mktemp", "mklibs" ... If version is present in package name (dash is the separator character), take it. For example: "apt-0.9.9.4" prevails over "apt". And finally, use sort -u to get unique names!

199 Fibonacci Numbers - 35 entries

Generate 199 Fibonacci Numbers using, if you like, the function S(x,y), a vimscript to sum two big numbers in reverse order.

LaTeX to XML Math Delimiters - 35 entries

Vim is amazing when used to edit MediaWiki text, but typing "<math> . . . </math>" can be tiresome and frustrating if formulas are used often. LaTeX delimiters are so concise and even come in two flavors: "\( . . . \)" for inline math and "\[ . . . \]" for centered formulas. The goal is to perform the following conversions: "\( . . . \)" becomes "<math>. . .</math>" "\[ . . . \]" becomes "<center><math>. . .</math></center>"

50 factorials mod 97 - 24 entries

List 1! to 50!, but give your answer mod 97.

VimGolf Chatter