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 - 1018 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: #236 / 298
  • Number of attempts: 3
Surround the 'z' character with brackets, quotes, and print as formatted string. - 447 entries

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

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

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

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #172 / 517
  • Number of attempts: 4
swap number pairs - 2000 entries

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

  • Best score: 16
  • Best player score: 36
  • Position: #290 / 368
  • Number of attempts: 3
Rural Post - 4347 entries

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

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

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #384 / 511
  • Number of attempts: 5
Replace pattern with 1, 2, 3, ... on each line - 1089 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: #212 / 222
  • Number of attempts: 1
Simple, Practical, and Common - 33343 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 / 7356
  • Number of attempts: 7
Hogwarts Email Sorting - 875 entries

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

  • Best score: 20
  • Best player score: 27
  • Position: #209 / 253
  • Number of attempts: 1
Swap values - 4534 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #780 / 1254
  • Number of attempts: 2
prepend * to every non-blank line - 6196 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #740 / 1513
  • Number of attempts: 1
One number per line - 18611 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1333 / 3840
  • Number of attempts: 8
Quote modules - 1046 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #202 / 272
  • Number of attempts: 2
V to the i - 4743 entries

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

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

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

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

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 28
  • Position: #218 / 254
  • Number of attempts: 2
Add semicolons - 10783 entries

Simply add a semicolon at the end of each line

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

easy stuff

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

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

  • Best score: 12
  • Best player score: 39
  • Position: #755 / 815
  • Number of attempts: 1
Box it - 7818 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #804 / 1861
  • Number of attempts: 7
From argument to object - 1469 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: #343 / 449
  • Number of attempts: 8
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #266 / 700
  • Number of attempts: 8
Copy three lines - 2839 entries

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

  • Best score: 13
  • Best player score: 39
  • Position: #621 / 634
  • Number of attempts: 1
Extract argument from function - 2308 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #386 / 742
  • Number of attempts: 13
That hyphen - 2554 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #614 / 694
  • Number of attempts: 8
Just the middle - 11345 entries

Delete the instructions at the top and bottom.

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

The team names are misspelled.

  • Best score: 16
  • Best player score: 26
  • Position: #564 / 581
  • Number of attempts: 3
Make HTML List - 1039 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 51
  • Position: #226 / 271
  • Number of attempts: 3
Basic renumbering - 5576 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 23
  • Position: #1071 / 1255
  • Number of attempts: 3
Fiddle percentages into real numbers - 840 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: #202 / 287
  • Number of attempts: 2
Vice versa - 7761 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #967 / 2093
  • Number of attempts: 12
Array transposition - 2378 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 29
  • Position: #364 / 443
  • Number of attempts: 4
Collect List - 4260 entries

Convert to comma separated list.

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

Based on "The name of the game".

  • Best score: 12
  • Best player score: 27
  • Position: #336 / 342
  • Number of attempts: 3
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 20
  • Position: #268 / 440
  • Number of attempts: 6
I forgot quotes - 15918 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2029 / 4158
  • Number of attempts: 2
-a-b-c- - 3169 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #312 / 1126
  • Number of attempts: 6
Don't know what this is - 1978 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: #376 / 578
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10615 entries

A HAPPY NEW YEAR 2014 !

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

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

  • Best score: 19
  • Best player score: 37
  • Position: #605 / 692
  • Number of attempts: 2
quotes inside quotes - 3124 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: #508 / 1071
  • Number of attempts: 6
Words in parens - 12848 entries

We should all ace this, right?

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

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

  • Best score: 9
  • Best player score: 11
  • Position: #209 / 225
  • Number of attempts: 4
Saving the hashes(#) - 1992 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: #441 / 473
  • Number of attempts: 7
Let's play some Ivmgolf - 1084 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 12
  • Position: #409 / 440
  • Number of attempts: 2
Vertical Limit - 2426 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #381 / 733
  • Number of attempts: 5
replacing each line of a block selection - 2923 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #551 / 763
  • Number of attempts: 6
Switch function arguments - 2050 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #188 / 644
  • Number of attempts: 8
Remove noise from HTTP log - 692 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: #259 / 269
  • Number of attempts: 3
Remove semicolons after expressions - 626 entries

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

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

how fast can you switch two variable ?

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

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 25
  • Position: #541 / 638
  • Number of attempts: 3
咸糖🎯
Twitter:

I use neovim BTW

entered into 53 challenges

contributed 0 challenges