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

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

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

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

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #177 / 551
  • Number of attempts: 4
swap number pairs - 2023 entries

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

  • Best score: 16
  • Best player score: 36
  • Position: #293 / 373
  • Number of attempts: 3
Rural Post - 4427 entries

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

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

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #384 / 522
  • Number of attempts: 5
Replace pattern with 1, 2, 3, ... on each line - 1114 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: #217 / 228
  • Number of attempts: 1
Simple, Practical, and Common - 33483 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 / 7384
  • Number of attempts: 7
Hogwarts Email Sorting - 891 entries

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

  • Best score: 20
  • Best player score: 27
  • Position: #213 / 257
  • Number of attempts: 1
Swap values - 4554 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #783 / 1259
  • Number of attempts: 2
prepend * to every non-blank line - 6254 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #750 / 1530
  • Number of attempts: 1
One number per line - 18673 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1338 / 3852
  • Number of attempts: 8
Quote modules - 1066 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #207 / 278
  • Number of attempts: 2
V to the i - 4771 entries

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

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

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

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

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 28
  • Position: #220 / 256
  • Number of attempts: 2
Add semicolons - 10831 entries

Simply add a semicolon at the end of each line

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

easy stuff

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

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

  • Best score: 12
  • Best player score: 39
  • Position: #778 / 839
  • Number of attempts: 1
Box it - 7849 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #807 / 1870
  • Number of attempts: 7
From argument to object - 1481 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: #346 / 453
  • Number of attempts: 8
Every other line - 2902 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #268 / 702
  • Number of attempts: 8
Copy three lines - 2869 entries

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

  • Best score: 13
  • Best player score: 39
  • Position: #626 / 639
  • Number of attempts: 1
Extract argument from function - 2337 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #391 / 750
  • Number of attempts: 13
That hyphen - 2572 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #617 / 698
  • Number of attempts: 8
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

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

The team names are misspelled.

  • Best score: 16
  • Best player score: 26
  • Position: #567 / 585
  • 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 - 5605 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 23
  • Position: #1076 / 1260
  • Number of attempts: 3
Fiddle percentages into real numbers - 841 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: #203 / 288
  • Number of attempts: 2
Vice versa - 7865 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #973 / 2114
  • Number of attempts: 12
Array transposition - 2407 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 29
  • Position: #366 / 445
  • Number of attempts: 4
Collect List - 4267 entries

Convert to comma separated list.

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

Based on "The name of the game".

  • Best score: 12
  • Best player score: 27
  • Position: #338 / 344
  • Number of attempts: 3
Space out the alphabet - 1630 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 20
  • Position: #269 / 442
  • Number of attempts: 6
I forgot quotes - 15946 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2033 / 4166
  • Number of attempts: 2
-a-b-c- - 3183 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #312 / 1132
  • Number of attempts: 6
Don't know what this is - 1996 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: #379 / 581
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

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

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

  • Best score: 19
  • Best player score: 37
  • Position: #606 / 695
  • Number of attempts: 2
quotes inside quotes - 3128 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: #510 / 1073
  • Number of attempts: 6
Words in parens - 12868 entries

We should all ace this, right?

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

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

  • Best score: 9
  • Best player score: 11
  • Position: #210 / 227
  • Number of attempts: 4
Saving the hashes(#) - 2008 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: #444 / 476
  • Number of attempts: 7
Let's play some Ivmgolf - 1096 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 12
  • Position: #411 / 442
  • Number of attempts: 2
Vertical Limit - 2487 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #387 / 748
  • Number of attempts: 5
replacing each line of a block selection - 2966 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #557 / 772
  • Number of attempts: 6
Switch function arguments - 2085 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #188 / 653
  • Number of attempts: 8
Remove noise from HTTP log - 700 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: #261 / 272
  • Number of attempts: 3
Remove semicolons after expressions - 639 entries

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

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

how fast can you switch two variable ?

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

Pretty simple, number the list.

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

I use neovim BTW

entered into 53 challenges

contributed 0 challenges