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]

30170 active golfers, 368645 entries, 507 challenges

Open VimGolf challenges

vimtutor, but you can cheat - 4 entries

It's time to revisit vimtutor, but as an experienced Vim user! Your goal is to change the file to appear as if you had gone through the tutorial, but you do NOT need to actually complete the tutorial as written or do anything that doesn't result in changes to the file. You may use whatever you have in your Vim toolbelt that's allowed under VimGolf rules. The whole tutorial is too large to submit, so only the relevant lesson headers and associated practice lines are presented in this challenge. You will have to reference the tutor for the original instructions if you need them: https://raw.githubusercontent.com/vim/vim/4466ad6baa22485abb1147aca3340cced4778a66/runtime/tutor/tutor

A grid of punctuation - 112 entries

Create a checkerboard of = and - in an 80×24 grid!

Fix the Haiku - 249 entries

Change this slightly scrambled haiku to its unscrambled form and fix the capitalisation and punctuation along the way.

Top X - 185 entries

The End File is the Top 10 Vimgolf Leaderboard at June 29, 2013. This is a second version, with a great contribution of @udioica. X is ten in Roman,a numeric system in ancient Rome

Change attribute to getter - 98 entries

Wrap attributes with a getter method.

Hash staircase - 38 entries

Can you use a strategy to come up with this pattern?

Sort the cardinal numbers - 236 entries

Maybe a simple challenge.

Round Round - 242 entries

Round Round

Subtraction - 155 entries

Solve the equations.

Inner hyphens - 115 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

increment by column in XML - 143 entries

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

Change name of a variable - 153 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

If-then-else regexp - 37 entries

Rules: - golf is never following golf - vim comes first! Drawing a finite-state machine diagram could help. #regexp

Recursively Palindrome - 225 entries

Note that there are 2^6-1 characters.

Python to Ruby - 188 entries

Convert this Python code to Ruby. NOTE: This program likely won't run.

Java Array2List - 216 entries

Convert an java array initializer into a list.

Interleave lines - 127 entries

This is some kind of « paste -d'\n' c b a ». There are many ways to achieve this.. just find the shortest!

Cleanining up 80 column concatenated text - 185 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

On Being Stylish - 51 entries

Your PR cannot be accepted if you don't follow our corporate style guide.

Sorting a glossary - 103 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

Generate Fibonacci Numbers - 211 entries

Use your super vim powers to generate Fibonacci Numbers.

citizen_hacks_2019_challenge1 - 29 entries

For the Citizen Hacks 2019 Vim competition

Pretty format for variable declarations - 129 entries

Project standards demand the equal signs must be aligned for better readability.

Parsing with CSV: Unify lines and result. - 163 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

Cartesian product - 206 entries

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

Another Mixed-Up Haiku - 206 entries

VimGolf ... a perfect evening?

Shuffle and Sort - 172 entries

The values where sorted incorrectly. Get them back to how they are supposed to be

Refactor arguments into object argument - 159 entries

A relatively common Javascript refactoring.

simple format (3) - 43 entries

reverse two column values!

Block Fun 1 - 161 entries

Manipulate the columns to produce desired result.

It'ss tooo coold too typpe todaay - 199 entries

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

Rule 110 - 32 entries

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

NBCU Weekly Challenge - #0 - 124 entries

One of our favorites lines here at NBCU! p.s. The first version of #0 was deleted due to me copy/pasting a HTML entity. Congrats to the one who figured that out, you are a true ninja warrior!

Assign list - 146 entries

Assign list elements to matrix

Complete the hex array data - 188 entries

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

create arrows in a list - 70 entries

Add arrow at same distance

Multiplication table. - 183 entries

Create a multiplication table.

Turn this csv list into queries - 190 entries

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

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

Convert this tiny php class to adequate java one.

Unwrap the text of an email message - 154 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?

Getters & Setters: Java - 189 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...

Manual SQL - 98 entries

Change select and insert queries to simulate inserting a new record.

Aligning function arguments to match a specific coding style - 161 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.

Fun With The Diagonal - 91 entries

change the lowercase characters on the main diagonal to uppercase

snowflake fractal - 36 entries

From step 0 to step 3 of a fractal

Dehamlizing - 156 entries

Change this piece of HAML code back into erb

Extract HTML option values from tag values - 74 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.

Test everything! - 113 entries

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

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/

constructor - 165 entries

coding a constructor for a simple class

VimGolf Chatter