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

Find fix point of cos - 1485 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 22
  • Position: #343 / 434
  • Number of attempts: 3
Surround the 'z' character with brackets, quotes, and print as formatted string. - 582 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #65 / 328
  • Number of attempts: 4
Paste a column after a column - 2668 entries

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

  • Best score: 14
  • Best player score: 24
  • Position: #404 / 578
  • Number of attempts: 8
Put a newline after every 10 lines in vim - 1688 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #179 / 567
  • Number of attempts: 4
swap number pairs - 2173 entries

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

  • Best score: 16
  • Best player score: 36
  • Position: #306 / 394
  • Number of attempts: 3
Rural Post - 4596 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #194 / 1122
  • Number of attempts: 12
Yo To Hello - 1155 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #385 / 536
  • Number of attempts: 5
Replace pattern with 1, 2, 3, ... on each line - 1161 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

  • Best score: 21
  • Best player score: 54
  • Position: #223 / 235
  • Number of attempts: 1
Simple, Practical, and Common - 33982 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: 22
  • Position: #2380 / 7508
  • Number of attempts: 7
Hogwarts Email Sorting - 952 entries

Given a list of emails, get the students full name and their associated house.

  • Best score: 20
  • Best player score: 27
  • Position: #226 / 271
  • Number of attempts: 1
Swap values - 4703 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #794 / 1291
  • Number of attempts: 2
prepend * to every non-blank line - 6390 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #759 / 1560
  • Number of attempts: 1
One number per line - 18894 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1349 / 3901
  • Number of attempts: 8
Quote modules - 1102 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #215 / 290
  • Number of attempts: 2
V to the i - 4864 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #784 / 1912
  • Number of attempts: 2
Applying same text modification in several lines - 2929 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #23 / 866
  • Number of attempts: 6
Add string initializers to an enum - 903 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 28
  • Position: #228 / 266
  • Number of attempts: 2
Add semicolons - 10951 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #757 / 3096
  • Number of attempts: 6
remove lines containing the word "reader" - 3646 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #494 / 1183
  • Number of attempts: 7
Com(m)a Trouble - 3990 entries

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

  • Best score: 12
  • Best player score: 39
  • Position: #842 / 909
  • Number of attempts: 1
Box it - 7999 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #812 / 1899
  • Number of attempts: 7
From argument to object - 1552 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: 20
  • Position: #358 / 469
  • Number of attempts: 8
Every other line - 2945 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #269 / 710
  • Number of attempts: 8
Copy three lines - 2911 entries

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

  • Best score: 13
  • Best player score: 39
  • Position: #632 / 645
  • Number of attempts: 1
Extract argument from function - 2401 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #400 / 768
  • Number of attempts: 13
That hyphen - 2624 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #623 / 708
  • Number of attempts: 8
Just the middle - 11611 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1500 / 4252
  • Number of attempts: 5
Team names - 1860 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 26
  • Position: #577 / 595
  • Number of attempts: 3
Make HTML List - 1071 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 51
  • Position: #230 / 275
  • Number of attempts: 3
Basic renumbering - 5731 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 23
  • Position: #1091 / 1277
  • Number of attempts: 3
Fiddle percentages into real numbers - 884 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: 16
  • Position: #207 / 296
  • Number of attempts: 2
Vice versa - 8011 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #985 / 2153
  • Number of attempts: 12
Array transposition - 2474 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 29
  • Position: #373 / 459
  • Number of attempts: 4
Collect List - 4333 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #522 / 1197
  • Number of attempts: 7
VimGolfNight - 583 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 27
  • Position: #348 / 354
  • Number of attempts: 3
Space out the alphabet - 1691 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 20
  • Position: #275 / 455
  • Number of attempts: 6
I forgot quotes - 16185 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2054 / 4221
  • Number of attempts: 2
-a-b-c- - 3237 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #312 / 1145
  • Number of attempts: 6
Don't know what this is - 2048 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: 14
  • Position: #384 / 592
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10749 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1596 / 3712
  • Number of attempts: 3
attr_aligner - 3565 entries

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

  • Best score: 19
  • Best player score: 37
  • Position: #617 / 709
  • Number of attempts: 2
quotes inside quotes - 3200 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: #515 / 1091
  • Number of attempts: 6
Words in parens - 13033 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 13
  • Position: #14 / 3987
  • Number of attempts: 10
Delete unwanted lines - 441 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 11
  • Position: #217 / 235
  • Number of attempts: 4
Saving the hashes(#) - 2115 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: 38
  • Position: #454 / 487
  • Number of attempts: 7
Let's play some Ivmgolf - 1153 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 12
  • Position: #423 / 457
  • Number of attempts: 2
Vertical Limit - 2634 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #401 / 776
  • Number of attempts: 5
replacing each line of a block selection - 3050 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #566 / 787
  • Number of attempts: 6
Switch function arguments - 2204 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #188 / 681
  • Number of attempts: 8
Remove noise from HTTP log - 742 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 25
  • Position: #269 / 280
  • Number of attempts: 3
Remove semicolons after expressions - 676 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #133 / 268
  • Number of attempts: 7
switch variable - 5120 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #662 / 1761
  • Number of attempts: 4
Numbering a List - 1944 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 25
  • Position: #558 / 659
  • Number of attempts: 3
咸糖xiantang
Twitter:

I have Neovim mania.

entered into 53 challenges

contributed 0 challenges