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]

30737 active golfers, 372891 entries, 513 challenges

Open VimGolf challenges

Rail fence transposition cipher - 70 entries

Solve a rail fence transposition cipher using vim. This ciphertext was created using two rails. Use vim to transpose the text and recover the original quote.

Format the output - 102 entries

Sometimes your standard out is a little hard to read. Take this multilevel hash and make it human readable.

Printable ASCII characters - 95 entries

From a blank input, print all 95 printing ASCII characters one per line, from space to tilde.

Ninjas Leaderboard - 84 entries

The two lines in "Start file" has an obfuscated email address. Second line give an index (from 1 to 30) to the chars list of the first line, for example, the first char of email (n) is in position 25, second char (i) is in position 19 and s.o.

Label grid cells (6x6) - 18 entries

Label the cells of a grid with its coordinates. Rows are labelled top to bottom from A to F, and columns left to right from A to F. Each cell has a coordinate MN, where M is the row letter and N is the column letter.

SFD-ROC: Pipe Dreams - 93 entries

Move the pipes so they match the output.

Pascal's Triangle - 22 entries

Generate the first 17 left-justified rows of Pascal's triangle.

42-header - 36 entries

Rush 42mexican-standoff at 42 school

paste indent correction - JS - 83 entries

You copy some javascript code from a website and paste it into vim, it does not look good!

Linear congruential generator - 108 entries

http://en.wikipedia.org/wiki/Linear_congruential_generator

Sudoku table - 58 entries

Make this simple sudoku table look nice and legible.

Comparing scores - 69 entries

If Alice and Bob both did the challenge, put their entries together in the top paragraph, so we can compare their scores more easily.

Simple Maths 2 - 19 entries

Time to practice expression register! #maths #linear

Execute immediate SQL - 84 entries

Sql string tranformation ...

Not enough Ps - 61 entries

Different type of code

It's a factor - 80 entries

Flaunt your macro prowess by factoring some numbers. Too hard? It takes less than 30 strokes, I promise.

Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 42 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

Remove Accent off the Letter - 100 entries

Remove all the accent from extremely accented statements.

Chucking wood - 80 entries

An exercise in compressing repetitive text. For this challenge, any entry that uses keys outside the main row (such as arrow keys, Home, End, Delete, etc.) will be removed. (Esc is OK, though you should be using C-[ anyway.)

Replace Parameter with Explicit Methods - 61 entries

Implementing the methods of a Java Interface

My cafe needs a new menu - 22 entries

Help! My cafe needs a new menu and I've only got this plain-text file from the kitchen. In order to get it printed, I need to transform it into a markdown file with; headings for each type of item, prices on each menu item, dietary options and a key down the bottom.

citizen_hacks_2019_part1 - 15 entries

For the Citizen Hacks 2019 Vim competition

Sierpinski's Triangle - 79 entries

Build the famous fractal, Sierpinski's Triangle.

Before there was Farmville... - 92 entries

There was old MacDonald. For my toddler. The first Vim sing-a-long?

Roman numerals - 58 entries

Use the substitutions on top to convert unary to Roman numerals.

Create an alphabet diamond - 76 entries

Here's a brain teaser to keep things interesting...

Python: Lots of function arguments - 73 entries

The function definition is too long for one line. The modeline helps you with some typical Python indent settings.

HTML formatting: vertical alignment for readability - 60 entries

We did this a VimGolf challenge at work and now that we have finished I want to see if you guys can come up with something even better than we could. Our best solution was 44 keystrokes.

PHP <--> Java class conversion Part 2 - 84 entries

Same class but reverse!

citizen_hacks_2019_part6 - 14 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part3 - 14 entries

For the Citizen Hacks 2019 Vim competition

Chinese Multiplication Table - 70 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.

SFD-ROC: ROT13 Phonics - 73 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

Double and switch - 37 entries

Aaaanother case switcher

Harder than "abcd > a b c d" - 71 entries

Not as easy as the last challenge. This time, just one space between a and b, up to 25 spaces between y and z. (Removed some lines; diff was too long.)

Five Pillars - 60 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.

Make the circuit grid! - 73 entries

Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.

Circle of Fifths with Sharps - 71 entries

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

Complete the circuit grid! - 72 entries

Continuing from the last challenge, add additional rows to the grid. Change each of the names from 'A1'...'A10' to 'B1'...'B10', 'C1'...'C10', etc, and for each new row add 0.7 to the X values in the (X Y) at the end of each line.

Lower cased and dashed strings - 46 entries

As I have to generate big fixtures files, I wanted to find a way to format input data the way described by start and end files. Especially the lower-cased-and-dashed ids Not so good to find a pure Vim way, that's why I submit this challenge ;)

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

Lookahead and Lookbehind - 65 entries

Look everywhere

Permutations N=4 - 60 entries

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

Transposition - 67 entries

Transpose the original lines in separate columns, one for each line.

citizen_hacks_2019_part5 - 13 entries

For the Citizen Hacks 2019 Vim competition

JSON string rotation - 51 entries

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

Flip the chessboard - 67 entries

White's turn is over. Flip the board to black's perspective. I added coordinates to frustrate you.

Dumb to smart - 82 entries

Turn dumb quote to smart vim's way.

SFD-ROC: ASCII Logo Border - 68 entries

Draw a border around this familiar logo ;)

C# function to F# - 7 entries

Converting from C# to F# is not hard, but requires some manual labor. Here you should convert a C# function using a C# class to a F# function using a C# class.

VimGolf Chatter