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]

Played Challenges

Wikitext headings to markdown - 30 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 22
  • Position: #6 / 13
  • Number of attempts: 3
hello-world-vimgolf - 314 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #27 / 104
  • Number of attempts: 1
Contribute to keyboard mashing - 279 entries

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #56 / 84
  • Number of attempts: 2
Reordering Lorem Ipsum - 74 entries

Who even sorted this?

  • Best score: 13
  • Best player score: 14
  • Position: #11 / 22
  • Number of attempts: 1
Fill in the chess board - 239 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 20
  • Position: #15 / 55
  • Number of attempts: 3
Learn to ask for :help - 209 entries

Learn to use the help to reduce your strokes...

  • Best score: 19
  • Best player score: 24
  • Position: #18 / 51
  • Number of attempts: 3
Plotting some variables in python - 635 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 34
  • Position: #28 / 128
  • Number of attempts: 7
Create a diamond comment - 160 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 27
  • Position: #6 / 41
  • Number of attempts: 5
Enumerate Bullets - 140 entries

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

  • Best score: 20
  • Best player score: 27
  • Position: #28 / 37
  • Number of attempts: 2
Put a cross in the square - 91 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 22
  • Position: #18 / 42
  • Number of attempts: 3
Simple, Practical, and Common - 32778 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.

  • Best score: 22
  • Best player score: 23
  • Position: #2748 / 7242
  • Number of attempts: 5
Swap values - 4409 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #510 / 1235
  • Number of attempts: 3
One number per line - 18295 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #1967 / 3770
  • Number of attempts: 15
Swap values inside brackets - 2417 entries

Easy challenge.

  • Best score: 14
  • Best player score: 18
  • Position: #339 / 557
  • Number of attempts: 3
V to the i - 4617 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1460 / 1847
  • Number of attempts: 4
Applying same text modification in several lines - 2713 entries

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

  • Best score: 12
  • Best player score: 17
  • Position: #616 / 807
  • Number of attempts: 4
Swap the operands under comparison - 253 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 20
  • Position: #37 / 91
  • Number of attempts: 2
Split line with dots - 2085 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 19
  • Position: #349 / 619
  • Number of attempts: 4
remove lines containing the word "reader" - 3436 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #821 / 1113
  • Number of attempts: 3
Com(m)a Trouble - 3308 entries

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

  • Best score: 12
  • Best player score: 15
  • Position: #390 / 746
  • Number of attempts: 3
Box it - 7661 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #439 / 1830
  • Number of attempts: 6
Triangular Numbers - 82 entries

Generate the first 50 triangular numbers.

  • Best score: 18
  • Best player score: 21
  • Position: #17 / 24
  • Number of attempts: 7
Cool or not? - 748 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 19
  • Position: #139 / 214
  • Number of attempts: 4
multiple cursor alternative - 1441 entries

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

  • Best score: 19
  • Best player score: 23
  • Position: #270 / 368
  • Number of attempts: 4
From argument to object - 1258 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?

  • Best score: 17
  • Best player score: 18
  • Position: #239 / 416
  • Number of attempts: 2
Two pairs of cluster of letters creates word - 706 entries

Clean and group.

  • Best score: 17
  • Best player score: 22
  • Position: #116 / 165
  • Number of attempts: 5
Every other line - 2790 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #507 / 679
  • Number of attempts: 3
Copy three lines - 2767 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #241 / 620
  • Number of attempts: 5
Convert Application Output to CSV - 171 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 20
  • Position: #43 / 48
  • Number of attempts: 5
Extract argument from function - 2195 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #373 / 724
  • Number of attempts: 1
Search and Replace 0 - 4591 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #680 / 1521
  • Number of attempts: 2
Preferably without multi-cursor plugin - 466 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/

  • Best score: 30
  • Best player score: 34
  • Position: #50 / 115
  • Number of attempts: 7
Number Sort - 283 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Position: #126 / 151
  • Number of attempts: 1
That hyphen - 2472 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Position: #271 / 676
  • Number of attempts: 5
comment and uncomment code inline - 978 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.

  • Best score: 9
  • Best player score: 10
  • Position: #197 / 292
  • Number of attempts: 2
Letterbox - 86 entries

Make a box!

  • Best score: 35
  • Best player score: 46
  • Position: #10 / 23
  • Number of attempts: 3
Flip the bit - 104 entries

Change the specific 0 to a 1.

  • Best score: 8
  • Best player score: 9
  • Position: #34 / 63
  • Number of attempts: 2
Just the middle - 11086 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1476 / 4093
  • Number of attempts: 4
Team names - 1767 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #314 / 566
  • Number of attempts: 4
Learn some german verbs - 495 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 21
  • Position: #51 / 123
  • Number of attempts: 4
Missing Library and a Typo - 829 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #97 / 203
  • Number of attempts: 3
Basic renumbering - 5408 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #256 / 1221
  • Number of attempts: 3
Adam's challenge - 912 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #121 / 255
  • Number of attempts: 6
Fiddle percentages into real numbers - 794 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #151 / 270
  • Number of attempts: 3
ninja substitution - 1278 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 16
  • Position: #143 / 245
  • Number of attempts: 4
Vice versa - 7462 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #937 / 2023
  • Number of attempts: 3
Order and join - 858 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #127 / 236
  • Number of attempts: 5
comments galore - 965 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #295 / 408
  • Number of attempts: 3
Scrambled numbers - 772 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 18
  • Position: #43 / 179
  • Number of attempts: 3
Align commas - 1021 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.

  • Best score: 11
  • Best player score: 11
  • Position: #91 / 233
  • Number of attempts: 11
Python challenge - 132 entries

Change the types of the variables in the list from str to float, while keeping the truncation.

  • Best score: 31
  • Best player score: 33
  • Position: #10 / 40
  • Number of attempts: 4
One to Ten - 2072 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #339 / 635
  • Number of attempts: 2
Change part of a function name in multiple occurrences - 595 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #115 / 190
  • Number of attempts: 2
Build a six - 267 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 22
  • Position: #56 / 89
  • Number of attempts: 2
Increment each number - 946 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 24
  • Position: #197 / 233
  • Number of attempts: 5
Delete to the end of the current line - 711 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #245 / 348
  • Number of attempts: 2
Put the months in order - 915 entries

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

  • Best score: 20
  • Best player score: 37
  • Position: #71 / 155
  • Number of attempts: 4
move titles next to url, in quotes - 478 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 20
  • Position: #24 / 127
  • Number of attempts: 8
Array transposition - 2271 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 20
  • Position: #216 / 427
  • Number of attempts: 5
convert yml into java pojo field - 801 entries

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

  • Best score: 29
  • Best player score: 32
  • Position: #149 / 213
  • Number of attempts: 1
unknown command - 143 entries

I want change 5 words

  • Best score: 7
  • Best player score: 7
  • Position: #59 / 72
  • Number of attempts: 1
Simple format (2) - 306 entries

try again!

  • Best score: 23
  • Best player score: 33
  • Position: #42 / 64
  • Number of attempts: 10
Collect List - 4155 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #514 / 1161
  • Number of attempts: 6
Space out the alphabet - 1563 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Position: #108 / 427
  • Number of attempts: 3
I forgot quotes - 15668 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #1118 / 4099
  • Number of attempts: 10
-a-b-c- - 3085 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #416 / 1101
  • Number of attempts: 4
Don't know what this is - 1927 entries

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

  • Best score: 11
  • Best player score: 12
  • Position: #230 / 566
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10515 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2466 / 3630
  • Number of attempts: 2
attr_aligner - 3360 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #173 / 679
  • Number of attempts: 10
Letter case trickery - 1530 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.

  • Best score: 9
  • Best player score: 10
  • Position: #163 / 495
  • Number of attempts: 6
quotes inside quotes - 3003 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 :)

  • Best score: 14
  • Best player score: 15
  • Position: #487 / 1038
  • Number of attempts: 5
Words in parens - 12690 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1147 / 3906
  • Number of attempts: 8
Resort and deup a CSV list - 135 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.

  • Best score: 44
  • Best player score: 46
  • Position: #13 / 37
  • Number of attempts: 7
Pascal's Triangle - 27 entries

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

  • Best score: 36
  • Best player score: 43
  • Position: #10 / 12
  • Number of attempts: 1
Saving the hashes(#) - 1940 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.

  • Best score: 20
  • Best player score: 23
  • Position: #127 / 463
  • Number of attempts: 3
Vertical Limit - 2333 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #169 / 708
  • Number of attempts: 7
replacing each line of a block selection - 2768 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #213 / 729
  • Number of attempts: 5
Switch function arguments - 1955 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #310 / 620
  • Number of attempts: 3
switch variable - 4881 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #974 / 1694
  • Number of attempts: 6
Make it more readable - 1867 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #188 / 615
  • Number of attempts: 2
Whitespace, empty lines and tabs - 2805 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #120 / 639
  • Number of attempts: 8
Simple text editing with Vim - 11446 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1828 / 3361
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 5869 entries

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

  • Best score: 32
  • Best player score: 38
  • Position: #608 / 1451
  • Number of attempts: 2
Jean George
Twitter:

entered into 83 challenges

contributed 0 challenges