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

Quicksort - 1962 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 6
  • Position: #6 / 431
  • Number of attempts: 5
EDN reformat - 1158 entries

The goal is to make the code more readable and concise while maintaining its functionality.

  • Best score: 17
  • Best player score: 17
  • Position: #3 / 164
  • Number of attempts: 9
Remove line numbers - 736 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

  • Best score: 9
  • Best player score: 12
  • Position: #22 / 198
  • Number of attempts: 3
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: 14
  • Position: #32 / 415
  • Number of attempts: 9
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: #133 / 309
  • Number of attempts: 1
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: 14
  • Position: #70 / 553
  • Number of attempts: 8
Filter number combinations that don't add to 11 - 408 entries

Append the sum of each line to its end, alongside an equals sign, and remove any that do not sum to 11. The ordering of lines should stay the same. Note that the combinations are semi-arbitrary and not all 4-number combinations are present in the file.

  • Best score: 27
  • Best player score: 27
  • Position: #25 / 117
  • Number of attempts: 4
Fizzbuzz - 573 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 45
  • Best player score: 47
  • Position: #17 / 168
  • Number of attempts: 25
Many duplicates - 1445 entries

Quick and easy

  • Best score: 7
  • Best player score: 7
  • Position: #29 / 468
  • Number of attempts: 5
Generate a very basic Python constructor (fixed) - 1253 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 29
  • Position: #54 / 271
  • Number of attempts: 20
Fix the shell script! - 2544 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 28
  • Position: #158 / 589
  • Number of attempts: 9
Visual block training - 1070 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 17
  • Position: #7 / 204
  • Number of attempts: 15
Java to JavaScript - 269 entries

Let convert some simple Java file to JavaScript!

  • Best score: 59
  • Best player score: 59
  • Position: #11 / 74
  • Number of attempts: 15
Wikitext headings to markdown - 987 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 20
  • Position: #43 / 209
  • Number of attempts: 23
hello-world-vimgolf - 2499 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #83 / 708
  • Number of attempts: 6
Fill in the chess board - 959 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 19
  • Position: #31 / 185
  • Number of attempts: 23
Plotting some variables in python - 1661 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 34
  • Position: #50 / 348
  • Number of attempts: 11
Transpose a python matrix - 873 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 23
  • Position: #18 / 138
  • Number of attempts: 12
simple replacements - 1753 entries

The goal is to see the replacement commands in action.

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

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

  • Best score: 10
  • Best player score: 10
  • Position: #130 / 511
  • Number of attempts: 8
Python dataclasses - 1136 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 19
  • Position: #60 / 284
  • Number of attempts: 3
Making 3 line function a one liner. - 328 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #70 / 205
  • Number of attempts: 1
HS Final exam vimgolf - 897 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 21
  • Position: #22 / 236
  • Number of attempts: 10
Extend shell script - 134 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 37
  • Position: #7 / 45
  • Number of attempts: 7
Turn the x - 328 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 19
  • Position: #13 / 82
  • Number of attempts: 6
Rural Post - 4479 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #170 / 1097
  • Number of attempts: 8
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: 20
  • Position: #114 / 471
  • Number of attempts: 13
Capitalize the Names - 408 entries

I want to capitalize the names in quotes, but just the people's names, not the file names.

  • Best score: 21
  • Best player score: 21
  • Position: #47 / 97
  • Number of attempts: 7
Yo To Hello - 1130 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #387 / 524
  • Number of attempts: 4
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: 20
  • Position: #57 / 261
  • Number of attempts: 6
prepend * to every non-blank line - 6308 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #435 / 1537
  • 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: #732 / 3063
  • Number of attempts: 2
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: #167 / 865
  • Number of attempts: 6
Search and Replace 0 - 4989 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 14
  • Position: #1075 / 1624
  • Number of attempts: 1
Array of characters - 175 entries

We all copy paste things off the internet, but the syntax doesn't look right. Fix it as fast as possible.

  • Best score: 33
  • Best player score: 33
  • Position: #17 / 47
  • Number of attempts: 11
A grid of punctuation - 137 entries

Create a checkerboard of = and - in an 80×24 grid!

  • Best score: 16
  • Best player score: 16
  • Position: #30 / 61
  • Number of attempts: 4
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #107 / 254
  • Number of attempts: 3
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #524 / 1190
  • Number of attempts: 6
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Position: #75 / 281
  • Number of attempts: 4
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #305 / 1137
  • Number of attempts: 6
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #110 / 650
  • Number of attempts: 10
Insert a Markdown link - 439 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 22
  • Position: #13 / 147
  • Number of attempts: 7
The holy-grail may help - 366 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #158 / 209
  • Number of attempts: 3
Reformat most common surnames - 717 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 24
  • Position: #32 / 210
  • Number of attempts: 12
Remember FizzBuzz? - 725 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 39
  • Position: #13 / 190
  • Number of attempts: 11
Change the content of a string - 1580 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #214 / 588
  • Number of attempts: 5
Whitespace, empty lines and tabs - 3665 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 16
  • Position: #32 / 787
  • Number of attempts: 12
Simple text editing with Vim - 12811 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 13
  • Position: #693 / 3694
  • Number of attempts: 5
scpchicken
Twitter:

i like chicken

entered into 48 challenges

contributed 0 challenges