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 - 1402 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: #325 / 415
  • Number of attempts: 3
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: #65 / 309
  • Number of attempts: 4
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: 24
  • Position: #382 / 553
  • Number of attempts: 8
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: #177 / 556
  • Number of attempts: 4
swap number pairs - 2103 entries

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

  • Best score: 16
  • Best player score: 36
  • Position: #298 / 380
  • Number of attempts: 3
Rural Post - 4479 entries

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

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

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #384 / 524
  • Number of attempts: 5
Replace pattern with 1, 2, 3, ... on each line - 1146 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: #218 / 229
  • 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: 22
  • Position: #2380 / 7421
  • Number of attempts: 7
Hogwarts Email Sorting - 925 entries

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

  • Best score: 20
  • Best player score: 27
  • Position: #217 / 261
  • Number of attempts: 1
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #786 / 1268
  • Number of attempts: 2
prepend * to every non-blank line - 6312 entries

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

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

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1340 / 3864
  • Number of attempts: 8
Quote modules - 1084 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #209 / 281
  • Number of attempts: 2
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #784 / 1893
  • Number of attempts: 2
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: 12
  • Position: #23 / 851
  • Number of attempts: 6
Add string initializers to an enum - 872 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 28
  • Position: #221 / 258
  • Number of attempts: 2
Add semicolons - 10852 entries

Simply add a semicolon at the end of each line

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

easy stuff

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

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

  • Best score: 12
  • Best player score: 39
  • Position: #802 / 865
  • Number of attempts: 1
Box it - 7905 entries

Create a box around a line.

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

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #268 / 703
  • Number of attempts: 8
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: 39
  • Position: #627 / 640
  • Number of attempts: 1
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: #392 / 753
  • Number of attempts: 13
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #619 / 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: #1500 / 4197
  • Number of attempts: 5
Team names - 1836 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 26
  • Position: #570 / 588
  • Number of attempts: 3
Make HTML List - 1050 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 51
  • Position: #228 / 273
  • Number of attempts: 3
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 23
  • Position: #1080 / 1264
  • Number of attempts: 3
Fiddle percentages into real numbers - 865 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: #204 / 291
  • Number of attempts: 2
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #976 / 2128
  • Number of attempts: 12
Array transposition - 2417 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 29
  • Position: #367 / 448
  • Number of attempts: 4
Collect List - 4298 entries

Convert to comma separated list.

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

Based on "The name of the game".

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

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 20
  • Position: #270 / 444
  • Number of attempts: 6
I forgot quotes - 15983 entries

Oops.

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

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #312 / 1137
  • Number of attempts: 6
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: 14
  • Position: #380 / 585
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

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

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

  • Best score: 19
  • Best player score: 37
  • Position: #613 / 702
  • Number of attempts: 2
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: 15
  • Position: #511 / 1078
  • Number of attempts: 6
Words in parens - 12935 entries

We should all ace this, right?

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

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

  • Best score: 9
  • Best player score: 11
  • Position: #212 / 229
  • Number of attempts: 4
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: 38
  • Position: #448 / 480
  • Number of attempts: 7
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 12
  • Position: #413 / 445
  • Number of attempts: 2
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #392 / 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: 26
  • Position: #560 / 777
  • Number of attempts: 6
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #188 / 663
  • Number of attempts: 8
Remove noise from HTTP log - 717 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: #262 / 273
  • Number of attempts: 3
Remove semicolons after expressions - 654 entries

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

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

how fast can you switch two variable ?

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

Pretty simple, number the list.

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

I use neovim BTW

entered into 53 challenges

contributed 0 challenges