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

New teacher - 923 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 25
  • Position: #85 / 194
  • Number of attempts: 10
months to html list items - 1010 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 22
  • Position: #34 / 274
  • Number of attempts: 7
Quicksort - 1962 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 6
  • Position: #115 / 431
  • Number of attempts: 9
Populate 3D bone names list - 629 entries

Ran into this at work, excited to see how this gets optimized

  • Best score: 21
  • Best player score: 21
  • Position: #33 / 162
  • Number of attempts: 8
Remove line numbers - 736 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

  • Best score: 9
  • Best player score: 12
  • Position: #67 / 198
  • Number of attempts: 5
Surround the 'z' character with brackets, quotes, and print as formatted string. - 554 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #209 / 309
  • Number of attempts: 1
Paste a column after a column - 2537 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 14
  • Position: #99 / 553
  • Number of attempts: 4
Reformat symbols in list - 1621 entries

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

  • Best score: 24
  • Best player score: 24
  • Position: #61 / 348
  • Number of attempts: 5
Fizzbuzz - 573 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 45
  • Best player score: 45
  • Position: #3 / 168
  • Number of attempts: 21
Many duplicates - 1445 entries

Quick and easy

  • Best score: 7
  • Best player score: 7
  • Position: #37 / 468
  • Number of attempts: 4
delete swap - 1786 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #344 / 555
  • Number of attempts: 1
Fix the shell script! - 2544 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 30
  • Position: #241 / 589
  • Number of attempts: 5
Put a newline after every 10 lines in vim - 1657 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 10
  • Position: #43 / 556
  • Number of attempts: 5
Contribute to keyboard mashing - 890 entries

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #55 / 270
  • Number of attempts: 6
Plotting some variables in python - 1661 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: 51
  • Position: #218 / 348
  • Number of attempts: 1
xrandr outputs and dashes - 704 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 21
  • Position: #205 / 221
  • Number of attempts: 12
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #2023 / 3864
  • Number of attempts: 3
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #795 / 1893
  • Number of attempts: 2
remove lines containing the word "reader" - 3586 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #503 / 1162
  • Number of attempts: 4
Com(m)a Trouble - 3823 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #174 / 865
  • Number of attempts: 6
Box it - 7905 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #453 / 1876
  • Number of attempts: 6
multiple cursor alternative - 1519 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: 19
  • Position: #96 / 380
  • Number of attempts: 13
From argument to object - 1508 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: 17
  • Position: #165 / 458
  • Number of attempts: 5
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 12
  • Position: #84 / 703
  • Number of attempts: 7
Array propagate - 338 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 23
  • Position: #27 / 119
  • Number of attempts: 12
Extract argument from function - 2357 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #269 / 753
  • Number of attempts: 3
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #240 / 701
  • Number of attempts: 4
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1508 / 4197
  • Number of attempts: 2
Team names - 1836 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #282 / 588
  • Number of attempts: 3
Un"finnish"ed Work - 116 entries

Replace å by a, ä by a and ö by o.

  • Best score: 14
  • Best player score: 19
  • Position: #54 / 60
  • Number of attempts: 1
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #276 / 1264
  • Number of attempts: 12
Combines all items - 313 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #88 / 140
  • Number of attempts: 2
Order and join - 983 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Position: #83 / 259
  • Number of attempts: 4
comments galore - 1045 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #304 / 424
  • Number of attempts: 14
Align commas - 1095 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: #98 / 246
  • Number of attempts: 13
Change part of a function name in multiple occurrences - 662 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: 14
  • Position: #69 / 208
  • Number of attempts: 5
Increment each number - 1023 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 17
  • Position: #91 / 248
  • Number of attempts: 12
Delete to the end of the current line - 812 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #265 / 391
  • Number of attempts: 2
Put the months in order - 974 entries

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

  • Best score: 20
  • Best player score: 20
  • Position: #21 / 163
  • Number of attempts: 27
Array transposition - 2417 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 16
  • Position: #48 / 448
  • Number of attempts: 19
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 7
  • Position: #96 / 269
  • Number of attempts: 8
From A to B - 591 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 16
  • Position: #57 / 159
  • Number of attempts: 9
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 16
  • Position: #152 / 281
  • Number of attempts: 3
Fix the XML - 1039 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 26
  • Position: #203 / 290
  • Number of attempts: 1
ASCII box - 347 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 24
  • Position: #56 / 107
  • Number of attempts: 3
Condensed Cases - 804 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 12
  • Position: #65 / 247
  • Number of attempts: 5
Happy TvvO - 427 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #156 / 206
  • Number of attempts: 3
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #435 / 1137
  • Number of attempts: 4
Change name of a variable - 179 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Position: #128 / 137
  • Number of attempts: 1
Lisp Condense - 460 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 13
  • Position: #58 / 158
  • Number of attempts: 8
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #133 / 271
  • Number of attempts: 4
Neither Fizz nor Buzz - 253 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 13
  • Position: #14 / 103
  • Number of attempts: 4
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 32
  • Position: #293 / 300
  • Number of attempts: 2
Don't know what this is - 2022 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: 11
  • Position: #135 / 585
  • Number of attempts: 4
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #223 / 437
  • Number of attempts: 3
Shuffle puzzle - 346 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 13
  • Position: #22 / 104
  • Number of attempts: 5
Going underground.... - 356 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 23
  • Position: #9 / 128
  • Number of attempts: 9
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1609 / 3683
  • Number of attempts: 3
Simple text editing with Vim - 12811 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1994 / 3694
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6982 entries

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

  • Best score: 28
  • Best player score: 35
  • Position: #400 / 1706
  • Number of attempts: 6
Don'tBeAlarmed
Github:

entered into 60 challenges

contributed 0 challenges