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]

25633 active golfers, 286859 entries, 459 challenges

Open VimGolf challenges

Replace and keep the case - 347 entries

Replace all instance of plugin and Plugin to device and Device.

Combines all items - 244 entries

For each line that starts with the same number I want to combine its contents

Wrap text in quotes - 289 entries

All the blocks of text should be wrapped in quotation marks.

Mute the second method of this script - 412 entries

prepend a # infront of every line of the second method

Remove noise from HTTP log - 611 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

HTML to Haml - 722 entries

Help convert this HTML page to Haml.

The name of the game - 582 entries

End up with the name of the game.

Reverse Simple Deletion - 714 entries

You did the simple deletion, now reverse it.

Assignment Alignment - 695 entries

line up the operators. Use spaces, not tabs.

Generate a list of numbers - 249 entries

Please generate list of numbers from 1 to 20.

Lisp Condense - 387 entries

Reduce 4 cons selection operations down to one function call.

Prefixes and suffixes - 506 entries

Generate all prefixes of "vimchallenge", then all suffixes.

VimGolfNight - 458 entries

Based on "The name of the game".

Happy TvvO - 354 entries

Don’t forget the past, learn from it. Happy New Year.

Swap assigned value - 499 entries

Simple problem but looking for interesting solutions.

Interactive git rebase changing commands - 151 entries

How to change the action of some commits in git rebase dialog.

Minimalist Limerick - 481 entries

Reproduce this lovely poem.

lamb had a little Mary - 491 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

Braces or Brackets? - 626 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

120 Degrees - 366 entries

Rotate that triangle.

Angular naming conventions - 269 entries

In angular, a directive name follows the camelCase convention. When the directive is used in an HTML template, the words are instead separated by a dash. Go from to the other the fastest!

The meaning - 502 entries

Numbers are fun!

Reverse characters in a line - 585 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

imports alignment (python) - 577 entries

Align as one import per line.

citizen_hacks_2019_part9 - 2 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part4 - 2 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part2 - 2 entries

For the Citizen Hacks 2019 Vim competition

replace 2nd column blanks with values in same column if blank - 183 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

readability - 285 entries

Make the code readable by adding some spaces

Add to end of each line... kinda - 264 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

Line 'em up! - 275 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

ASCII box - 295 entries

Don't forget to fix typos!

Text to HTML Table - 143 entries

Turn the plain text table to an HTML table.

Ruby 1.9 compat - 557 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

Counting in binary - 393 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

Remove semicolons after expressions - 460 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

Pretty multi-line bash - 194 entries

Bash line continuations are much prettier when they're column aligned.

lipsum lines - 239 entries

Convert a quoted block of text into strings in a list.

Remember FizzBuzz? - 537 entries

Output FizzBuzz to 100. Start with nothing.

Vim tetris - 338 entries

Vim can play tetris too!

Logging with key - 275 entries

Sometimes it is better to log with meaningful key

vim = 22 / 7 - 398 entries

pi square vim

Interweave two blocks of text - 498 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

Reformat most common surnames - 520 entries

Reformat copy-pasted table into a list of the most common surnames

snowflake fractal - 34 entries

From step 0 to step 3 of a fractal

Reformat some Python - 511 entries

Fix some very bizarrely laid-out code.

NATO phonetic alphabet - 407 entries

Transform the series of words into a list.

Add Go XML to structure tags - 128 entries

The Go programming language can directly map XML to structure fields. Add the correct XML tag after each field.

Separate the lines - 126 entries

Every other line is mixed up. Separate them into their original texts.

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

VimGolf Chatter