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

Extract HTML option values from tag values - 76 entries

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

citizen_hacks_2019_challenge1 - 29 entries

For the Citizen Hacks 2019 Vim competition

constructor - 165 entries

coding a constructor for a simple class

formatted text to markdown - 175 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

Rule 110 - 33 entries

Compute the next 5 iterations of Rule 110 with the given starting state. https://en.wikipedia.org/wiki/Rule_110

Piphilology - 124 entries

Piphilology comprises the creation and use of mnemonic techniques to remember a span of digits of the mathematical constant π. http://en.wikipedia.org/wiki/Piphilology

Separating firstname & lastname - 109 entries

Seperate named with equal tabs.

SFD-ROC: The Quick Brown Fox - 148 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

Inconsistent real estate paste - 152 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

Almost encrypted - 176 entries

Convert the first paragraph to be even less readable.

Winning streak - 105 entries

Make the number on each line equal the consecutive L's or W's.

Groups magic - 140 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

REDRUM - 139 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

swap or reverse - 98 entries

Try to swap or reverse the line as needed.

snowflake fractal - 36 entries

From step 0 to step 3 of a fractal

Draw the Go board - 131 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))

Convert pandoc unordered list to a numbered list - 141 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?

Hidden Message - 61 entries

Find the hidden message and replace all other characters with spaces.

Assign numbers to fields - 90 entries

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

Staircase - 6 entries

Going downstairs, while singing the alphabet song. Some vb practice to us all. Would it be much easier to make it go from left to right instead?

Format java properties - 64 entries

Format java properties to a different format. The value which is the string following the first '=' cannot & should not change. All periods in the key get replaced with an underscore "_" and get a prefix of "b_".

ASCII Art - 80 entries

how good are you with simple regex?

Solve the Sokoban - 158 entries

A wink for all Vimgolfers that play Nethack too.

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.

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

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.

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.

The D a n k Side of the Moon - 30 entries

You're making a vaporwave cover of The Dark Side of the Moon. So for the tracklisting, you want to: 1. Change the track names to v a p o r c a s e 2. Double the track lengths (since you're slowing them down). Well... let's just double the minutes.

CSV to JSON - 143 entries

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

citizen_hacks_2019_challenge3 - 22 entries

For the Citizen Hacks 2019 Vim competition.

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.

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

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

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)

Square numbers - 81 entries

Boring math puzzle.

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?

Back to the roots - 42 entries

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

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?

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

Refactoring useless Method away - 78 entries

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

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 !

Calculate the table totals - 107 entries

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

Write Setters and Getters for PHP - 86 entries

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

Extract text from xml - 101 entries

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

Land of the Lost - 71 entries

Enter the tabs below the lyrics

Fill visual area - 71 entries

Just have fun!

VimGolf Chatter