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]

26185 active golfers, 298103 entries, 459 challenges

Open VimGolf challenges

Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

Hidden Message - 54 entries

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

Assign list - 145 entries

Assign list elements to matrix

Cartesian product - 201 entries

{1,2,3,4,5} X {1,2,3,4,5}

Another Mixed-Up Haiku - 201 entries

VimGolf ... a perfect evening?

Test everything! - 111 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

It'ss tooo coold too typpe todaay - 198 entries

My hands are numb with cold. It's hard to type correctly.

Winning streak - 105 entries

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

Complete the hex array data - 186 entries

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

Piphilology - 122 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

Unwrap the text of an email message - 150 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

Multiplication table. - 182 entries

Create a multiplication table.

Dehamlizing - 155 entries

Change this piece of HAML code back into erb

PHP <--> Java class conversion Part 1 - 178 entries

Convert this tiny php class to adequate java one.

Aligning function arguments to match a specific coding style - 159 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

Turn this csv list into queries - 189 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

Create a pandoc compatible table - 158 entries

In [this vimcast][1], a featured gist from Tim Pope shows how to quickly make a simple table structure. How fast can you convert it to pandoc's markdown style? [1]: http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

Separating firstname & lastname - 102 entries

Seperate named with equal tabs.

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.

ASCII Art - 76 entries

how good are you with simple regex?

constructor - 162 entries

coding a constructor for a simple class

swap or reverse - 91 entries

Try to swap or reverse the line as needed.

Assign numbers to fields - 85 entries

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

REDRUM - 136 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.

Groups magic - 136 entries

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

SFD-ROC: The Quick Brown Fox - 140 entries

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

Back to the roots - 38 entries

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

Inconsistent real estate paste - 142 entries

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

Almost encrypted - 165 entries

Convert the first paragraph to be even less readable.

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

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.

Circle in a square - 125 entries

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

42-header - 36 entries

Rush 42mexican-standoff at 42 school

Winding path - 91 entries

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

Solve the Sokoban - 158 entries

A wink for all Vimgolfers that play Nethack too.

PEP8 Python Wrapping Comments and Code - 155 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

Getters & Setters: Java - 154 entries

Boilerplate getters & setters - it's a tedious fact of life in Java, and probably the only thing that still pulls me back to an IDE. Perhaps someone knows a fast, pure vim way...

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

O Christmas Tree - 99 entries

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

Define to require - 113 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.

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 !

CSV to JSON - 143 entries

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

citizen_hacks_2019_part3 - 3 entries

For the Citizen Hacks 2019 Vim competition

Kolakoski sequence -- level 2 - 10 entries

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

Refactoring useless Method away - 78 entries

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

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)

Checkerboard case pattern - 106 entries

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

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

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

Write Setters and Getters for PHP - 86 entries

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

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

VimGolf Chatter