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

Cleanining up 80 column concatenated text - 184 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

Generate Fibonacci Numbers - 211 entries

Use your super vim powers to generate Fibonacci Numbers.

Parsing with CSV: Unify lines and result. - 162 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?

create arrows in a list - 65 entries

Add arrow at same distance

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

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

Refactor arguments into object argument - 158 entries

A relatively common Javascript refactoring.

Shuffle and Sort - 171 entries

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

Cartesian product - 202 entries

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

Another Mixed-Up Haiku - 202 entries

VimGolf ... a perfect evening?

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!

Block Fun 1 - 160 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.

Assign list - 146 entries

Assign list elements to matrix

Fun With The Diagonal - 89 entries

change the lowercase characters on the main diagonal to uppercase

Test everything! - 113 entries

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

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?

Manual SQL - 94 entries

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

Complete the hex array data - 186 entries

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

Multiplication table. - 182 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 - 178 entries

Convert this tiny php class to adequate java one.

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

Dehamlizing - 155 entries

Change this piece of HAML code back into erb

Format java properties - 63 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_".

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

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/

Winning streak - 105 entries

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

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.

constructor - 162 entries

coding a constructor for a simple class

Hidden Message - 56 entries

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

Separating firstname & lastname - 102 entries

Seperate named with equal tabs.

citizen_hacks_2019_part6 - 14 entries

For the Citizen Hacks 2019 Vim competition

SFD-ROC: The Quick Brown Fox - 143 entries

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

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 + ()

ASCII Art - 77 entries

how good are you with simple regex?

swap or reverse - 91 entries

Try to swap or reverse the line as needed.

Assign numbers to fields - 86 entries

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

Inconsistent real estate paste - 142 entries

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

Pascal's Triangle - 21 entries

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

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?

Simple Maths 2 - 17 entries

Time to practice expression register! #maths #linear

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.

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.

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

Circle in a square - 125 entries

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

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

Solve the Sokoban - 158 entries

A wink for all Vimgolfers that play Nethack too.

VimGolf Chatter