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]

30452 active golfers, 371086 entries, 513 challenges

Open VimGolf challenges

Add string initializers to an enum - 725 entries

Change Typescript enum so that it has string initializers.

RUST Cargo.toml version to last - 98 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

-a-b-c- - 3077 entries

Put hyphens everywhere.

attr_aligner - 3347 entries

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

Increment each number - 922 entries

Increment each number individually by one

Search and Replace 0 - 4510 entries

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

Split line with dots - 2075 entries

This line is too long, split it.

Generate a very basic Python constructor - 38 entries

I actually needed to do this myself, so I look forward to learning how.

Put the months in order - 885 entries

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

multiple cursor alternative - 1410 entries

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

RUST match with enum for Coin - 84 entries

RUST match with enum for Coin rusty practice on vimgolf

quotes inside quotes - 2996 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 :)

Multiline to Single Line - 256 entries

Convert a multiline, indented file to a single line with no whitespace

That hyphen - 2457 entries

"vim vi improved"

Cool or not? - 722 entries

abc trying to be cool or not...

Alphabet soup - 284 entries

Create a column of all alphabet characters organized in a funky way

Two pairs of cluster of letters creates word - 682 entries

Clean and group.

From argument to object - 1246 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?

Change double quotes to single quotes, but with a twist - 171 entries

Although this challenge is in the context of a Python function, you don't need to know Python to do this challenge. It is to add contexts and interesting constraints. The file contains a function that prints a multi-line string literal. I wrote the string literal with double quotes, but then I decided to use single quotes instead, and that's your challenge. However, interestingly enough, the string itself contains single and double quotes. This means, inside the string literal, the originally escaped double quotes no longer need to be escaped, but the single quotes now need to be escaped. Note that the triple double quotes in the docstring should be left alone.

Delete to the end of the current line - 700 entries

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

Extract argument from function - 2176 entries

The aim is to see if you can do some refactoring very fast.

ssh config skills - 137 entries

Parse output from `kuebctl get no -o wide` into an .ssh/config file!

html paragraph to table - 583 entries

reformat html paragraph to table

convert yml into java pojo field - 799 entries

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

replacing each line of a block selection - 2740 entries

replace each line's ../assets/js with /javascripts

Easy modification of ssh config - 112 entries

Just add another alias to each worker

Don't know what this is - 1905 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

Enumerate Bullets - 78 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

Whitespace, empty lines and tabs - 2762 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

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

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

Vertical Limit - 2294 entries

transform a succession of one word lines to a an array of strings

comment and uncomment code inline - 973 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

Space out the alphabet - 1520 entries

Put 3 spaces between adjacent letters.

Data reformat - 177 entries

Reformat this copy-paste data! #csv

Capitalize the Names - 186 entries

I want to capitalize the names in quotes, but just the people's names, not the file names.

Adam's challenge - 903 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

Saving the hashes(#) - 1921 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

Missing Library and a Typo - 815 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

Switch function arguments - 1919 entries

How to switch two arguments of a function.

move titles next to url, in quotes - 440 entries

had trouble with something similar

Align commas - 1000 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

Refactor typescript arrow function type - 264 entries

Make arrow function type less verbose and easier to read

Letter case trickery - 1515 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

Make it more readable - 1847 entries

Insert blank lines to make it more organized and readable

Fiddle percentages into real numbers - 784 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

Order and join - 834 entries

There's something special about the input order.

Python: Def to Lambda - 110 entries

LAMBDA!!!

comments galore - 945 entries

Basic comment reformatting

Numbering a List - 1774 entries

Pretty simple, number the list.

Make HTML List - 982 entries

Turn the comma separated list into an unordered html list.

VimGolf Chatter