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]

24049 active golfers, 261772 entries, 423 challenges

Open VimGolf challenges

Box it - 1237 entries

Create a box around a line.

ninja substitution - 38 entries

How can you reuse a previous substitution ?

Simple, Practical, and Common - 23292 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

simple format - 2013 entries

make it look better.

One number per line - 11720 entries

Just give me the numbers.

remove lines containing the word "reader" - 1085 entries

easy stuff

Two pairs of cluster of letters creates word - 231 entries

Clean and group.

One to Ten - 605 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

I forgot quotes - 11130 entries

Oops.

Applying same text modification in several lines - 1326 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

Cool or not? - 290 entries

abc trying to be cool or not...

Just the middle - 8843 entries

Delete the instructions at the top and bottom.

Com(m)a Trouble - 1148 entries

Someone was real stupid when placing his commas. Can you fix it?

Resort and deup a CSV list - 61 entries

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

Words in parens - 10718 entries

We should all ace this, right?

Swap values inside brackets - 1234 entries

Easy challenge.

Increment each number - 325 entries

Increment each number individually by one

A HAPPY NEW YEAR 2014 ! - 9319 entries

A HAPPY NEW YEAR 2014 !

Vice versa - 5698 entries

Little role switching.

Delete to the end of the current line - 351 entries

Delete to the end of the current line, but keep the character under the cursor.

Simple text editing with Vim - 10206 entries

Make the pairs of lines match up by making each second line same as first

Put the months in order - 313 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

Swap values - 3357 entries

Well, swap the values...

Change part of a function name in multiple occurrences - 326 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

move titles next to url, in quotes - 221 entries

had trouble with something similar

Basic renumbering - 4446 entries

Renumbering Basic.

Team names - 1361 entries

The team names are misspelled.

Collect List - 3354 entries

Convert to comma separated list.

convert yml into java pojo field - 598 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

Array transposition - 1473 entries

Transpose two arrays into one.

Convert Application Output to CSV - 66 entries

Change the application output to comma-separated values

V to the i - 3741 entries

Input is 99 V's. Output is 100 i's.

Build a six - 149 entries

Just enjoy building "a" floors...

Every other line - 1985 entries

AaAaAaA

Copy three lines - 1934 entries

If the site is up (by some miracle), make the text under every header identical.

Reformat/Refactor a Golfer Class - 5420 entries

A simple case of removing unneeded code and fixing broken indentation.

multiple cursor alternative - 1001 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

Split line with dots - 1754 entries

This line is too long, split it.

switch variable - 4212 entries

how fast can you switch two variable ?

From argument to object - 1038 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

Triangular Numbers - 33 entries

Generate the first 50 triangular numbers.

-a-b-c- - 2491 entries

Put hyphens everywhere.

attr_aligner - 2874 entries

Two attr keywords. Two separate indentations. Align the colons.

[Real World] PHP To Markdown - 14 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!

Search and Replace 0 - 3968 entries

Replace every instance of 'aaa' with 'xaaax'.

quotes inside quotes - 2691 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

Simple format (2) - 191 entries

try again!

That hyphen - 2037 entries

"vim vi improved"

Letterbox - 56 entries

Make a box!

Preferably without multi-cursor plugin - 229 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

VimGolf Chatter