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

HS exam question - 1589 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 57
  • Position: #102 / 417
  • Number of attempts: 4
delete swap - 1786 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #298 / 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: 28
  • Position: #160 / 589
  • Number of attempts: 10
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: 11
  • Position: #188 / 556
  • Number of attempts: 3
hello-world-vimgolf - 2499 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #300 / 708
  • Number of attempts: 2
simple replacements - 1753 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 19
  • Position: #81 / 380
  • Number of attempts: 16
Inverting Lines - 1900 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 11
  • Position: #263 / 511
  • Number of attempts: 5
swap number pairs - 2103 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 19
  • Position: #139 / 380
  • Number of attempts: 4
Rural Post - 4479 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 10
  • Position: #472 / 1097
  • Number of attempts: 4
Satisfy the go linter - 2391 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 21
  • Position: #198 / 471
  • Number of attempts: 9
Yo To Hello - 1130 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #389 / 524
  • Number of attempts: 1
Simple, Practical, and Common - 33617 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: 24
  • Position: #3112 / 7421
  • Number of attempts: 8
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #357 / 1268
  • Number of attempts: 8
prepend * to every non-blank line - 6311 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 10
  • Position: #437 / 1537
  • Number of attempts: 6
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #2021 / 3864
  • Number of attempts: 14
Swap values inside brackets - 2496 entries

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #107 / 579
  • Number of attempts: 14
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1493 / 1893
  • Number of attempts: 10
Applying same text modification in several lines - 2880 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #270 / 851
  • Number of attempts: 4
Add semicolons - 10852 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1769 / 3063
  • Number of attempts: 7
Bad Copy Syntax - 2037 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 18
  • Position: #33 / 525
  • Number of attempts: 5
Split line with dots - 2144 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 19
  • Position: #354 / 634
  • Number of attempts: 2
remove lines containing the word "reader" - 3586 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #853 / 1162
  • Number of attempts: 6
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: #168 / 865
  • Number of attempts: 19
Box it - 7905 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #809 / 1876
  • Number of attempts: 7
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: 20
  • Position: #198 / 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: #164 / 458
  • Number of attempts: 5
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 12
  • Position: #83 / 703
  • Number of attempts: 7
Copy three lines - 2872 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #249 / 640
  • Number of attempts: 6
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: 14
  • Position: #394 / 753
  • Number of attempts: 6
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Position: #380 / 701
  • Number of attempts: 8
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

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

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #281 / 588
  • Number of attempts: 4
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #273 / 1264
  • Number of attempts: 17
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #617 / 2128
  • Number of attempts: 17
comments galore - 1045 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #299 / 424
  • Number of attempts: 7
One to Ten - 2219 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: #358 / 672
  • Number of attempts: 2
Line under headers - 2044 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 27
  • Position: #201 / 503
  • Number of attempts: 6
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: 6
  • Position: #346 / 391
  • Number of attempts: 5
Array transposition - 2417 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 18
  • Position: #209 / 448
  • Number of attempts: 15
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #525 / 1190
  • Number of attempts: 10
VimGolfNight - 560 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #290 / 347
  • Number of attempts: 2
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Position: #137 / 444
  • Number of attempts: 9
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2038 / 4180
  • Number of attempts: 8
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #433 / 1137
  • Number of attempts: 2
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Position: #58 / 354
  • Number of attempts: 8
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: #133 / 585
  • Number of attempts: 8
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #220 / 437
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2508 / 3683
  • Number of attempts: 3
attr_aligner - 3520 entries

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

  • Best score: 19
  • Best player score: 22
  • Position: #225 / 702
  • Number of attempts: 14
Letter case trickery - 1630 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: 12
  • Position: #361 / 518
  • Number of attempts: 3
quotes inside quotes - 3159 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: 14
  • Position: #362 / 1078
  • Number of attempts: 8
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 13
  • Position: #16 / 3963
  • Number of attempts: 11
The name of the game - 665 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #279 / 360
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1606 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 8
  • Position: #128 / 446
  • Number of attempts: 10
Saving the hashes(#) - 2063 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: 26
  • Position: #210 / 480
  • Number of attempts: 7
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #139 / 445
  • Number of attempts: 4
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #257 / 754
  • Number of attempts: 5
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #231 / 777
  • Number of attempts: 5
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #189 / 663
  • Number of attempts: 5
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #140 / 419
  • Number of attempts: 5
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #665 / 1748
  • Number of attempts: 5
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #317 / 363
  • Number of attempts: 1
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #111 / 650
  • Number of attempts: 5
remove dupes from array - 1358 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 23
  • Position: #213 / 336
  • Number of attempts: 5
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #80 / 652
  • Number of attempts: 2
asirago
Twitter2:

something

entered into 65 challenges

contributed 0 challenges