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]

29248 active golfers, 350572 entries, 493 challenges

Open VimGolf challenges

Almost encrypted - 174 entries

Convert the first paragraph to be even less readable.

Assign numbers to fields - 90 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

ASCII Art - 78 entries

how good are you with simple regex?

Convert pandoc unordered list to a numbered list - 139 entries

I know it's possible to use #. in pandoc to auto-generate numbered lists, but then it's not easy to tell how many items there are when reading it in Markdown. How fast can you make the switch?

[Real World] PHP To Markdown - 25 entries

Fun refactoring I had to do in the real world. This presents several challenges: - How to create a table that fits the informations exactly - How to keep track of two informations per line while doing the refactoring - Generate the link from the actual text Have fun!

Draw the Go board - 121 entries

which is a 19×19 lines board. Here we use ascii characters only for simplicity. See diff file to get a sense. (See also http://en.wikipedia.org/wiki/Go_(game))

SFD-ROC: Tic-Tac-Toe - 131 entries

Tic-Tac-Toe You are 'X', and it is your turn. Stop 'O' from winning, and complete the game. Draw a diagonal line through your winning row of three X's.

Solve the Sokoban - 158 entries

A wink for all Vimgolfers that play Nethack too.

Checkerboard case pattern - 127 entries

All the squares are white. Make some of them black. But only the right ones.

Circle in a square - 125 entries

Probably looks more like "Egg in a rectangle" in most fonts, but it's actually 23x23.

PEP8 Python Wrapping Comments and Code - 157 entries

According to PEP8, long flowy text and code should have different max line lengths. Code: 79 characters max Long flowy text: 72 characters max

Define to require - 118 entries

When JSHint is enabled, there's a rule that doesn't let you have more than 6 arguments in a function, so the moment you need to add a 7th argument, you need to do a refactoring.

Winding path - 91 entries

It's a maze, but the bad paths have been blocked off. Mark the correct path.

CSV to JSON - 143 entries

A search for shortest vimissh way to convert CSV to JSON.

O Christmas Tree - 99 entries

Design a macro that makes trees grow (or ASCII triangles, if that's too hard).

Overall Vimgolf Rank - 137 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.

citizen_hacks_2019_part1 - 15 entries

For the Citizen Hacks 2019 Vim competition

Pascal's Triangle - 21 entries

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

Back to the roots - 39 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

Complete the hex array data (Part II) - 129 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

Simple Maths 2 - 18 entries

Time to practice expression register! #maths #linear

Changing URL path in CSS - 113 entries

What's the quickest way to swap out all the URLs in a CSS file? Is it wasted keystrokes using look-behinds and look-aheads? (I'm sorry for the delete/report--I made a mistake with the last one requiring an ugly search for graphic to replace with images. I just intended this to be a simple search and replace that might possibly generate some macros or normals solutions that are quicker)

Entries sort - 71 entries

It cames to my mind a weird idea : sorting parts of my .vimrc. Take few minutes to sort out this, it's easy !

Refactoring useless Method away - 78 entries

Real-life challenge, convert a bunch of ifs to a switch statement

The Universal Declaration of Human Rights, Article 1 - 129 entries

Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)

Happy New Year! - 129 entries

This is a simple new year's challenge.

Word Blender - 128 entries

The insides of long words seem to have been run through the blender. Can you fix this famous tale, brave knight?

citizen_hacks_2019_part6 - 14 entries

For the Citizen Hacks 2019 Vim competition

Write Setters and Getters for PHP - 86 entries

Just simple automation of writing Setters and Getters like Doctrine might use.

Letters are numbers - 127 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?

Extract text from xml - 101 entries

Extract text from xml file (ignoring commented out elements) and create a one line regex.

Calculate the table totals - 107 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

42-header - 36 entries

Rush 42mexican-standoff at 42 school

Fill visual area - 70 entries

Just have fun!

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.

Printable ASCII characters - 95 entries

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

Label grid cells (6x6) - 13 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.

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.

C# function to F# - 4 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.

Square numbers - 67 entries

Boring math puzzle.

SFD-ROC: Pipe Dreams - 93 entries

Move the pipes so they match the output.

Sudoku table - 58 entries

Make this simple sudoku table look nice and legible.

Format the output - 95 entries

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

Rail fence transposition cipher - 63 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.

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.

Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 41 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!

Land of the Lost - 60 entries

Enter the tabs below the lyrics

Linear congruential generator - 104 entries

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

Execute immediate SQL - 82 entries

Sql string tranformation ...

It's a factor - 78 entries

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

VimGolf Chatter