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]

28207 active golfers, 331931 entries, 479 challenges

Open VimGolf challenges

Create an alphabet diamond - 74 entries

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

Not enough Ps - 49 entries

Different type of code

Long prime list - filter version - 19 entries

I've used the maximum input/diff/output size allowed by vimgolf to get a list of integers up to 1460 separated by newlines, and your goal is to only keep the lines containing primes. There are 232 of them I hope some of you will golf vimscript itself to create some function to run as a primality check for each line, which is a good exercise if you haven't done much vimscript yet! You're invited to also try copy-pasting and doing other non-smart text manipulation. Even more interesting would be to see a solution that uses text manipulation to do the filtering! Whether you use vimscript, normal-mode primality checks, or text manipulation, as long as the end result is valid, your answer will be valid! Let's see which method does better here. Best of luck!

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"!

SFD-ROC: ROT13 Phonics - 71 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.

Lookahead and Lookbehind - 65 entries

Look everywhere

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.

Make the circuit grid! - 72 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.

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.

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

Flip the chessboard - 66 entries

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

ascii-art diamond - 33 entries

Simple ascii-art diamond. The grid is 40x40.

Dumb to smart - 81 entries

Turn dumb quote to smart vim's way.

SFD-ROC: ASCII Logo Border - 66 entries

Draw a border around this familiar logo ;)

Harder than "abcd > a b c d" - 64 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.)

Hanging Indent for Footnotes - 58 entries

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

Kolakoski sequence -- level 2 - 10 entries

This time, the line above describes the line below. Level 1 at: http://www.vimgolf.com/challenges/5c880211ab65cb00065c74eb

citizen_hacks_2019_part9 - 6 entries

For the Citizen Hacks 2019 Vim competition

Here, piggy, piggy... - 75 entries

Youay owknay atwhay otay oday...

Remove hard line breaks - 41 entries

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

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.

SQL to YAML - 33 entries

Should be easy with vim, or not?

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.

Flatten repo - 22 entries

For each git repository (<project> tag) translate name attribute to flatten directory structure. Add path attribute if missing (because checkout hierarchy must be kept). #xml

Greek column realign - 41 entries

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

Create bison tokens - 34 entries

Create tokens for bison out of a known list of words

Converting group lines from format A to Format B - 20 entries

Convert from one format to another

Binary and Increment - 41 entries

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

Return the cow - 71 entries

This cow is too verbose. Give it a lesson.

fib.c cleanup - 56 entries

cleanup the file

Tiny column alignment - 37 entries

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

Recursive Cowsay - 49 entries

Convert 'cowsay' statement to recursive output

Coordinates placeholder - 52 entries

Place coordinates instead of target search.

C to VimDict - 38 entries

Convert a C data structure to a Vimscript dictionary.

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.

50 factorials mod 97 - 36 entries

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

Enharmonic Equivalents - 52 entries

Transform # and b to digraphs

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!

Maze path - 32 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.

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 by your own sum - 47 entries

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

Sort with uniq OpenEmbedded package names - 33 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!

Presidential Sorting - 46 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!

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!)

Extended Customer 2 - 44 entries

Format the chars

Across-Down Flip - 42 entries

Do this instead of the Sunday crossword.

VimGolf Chatter