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

Put a newline after every 10 lines in vim - 1078 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #38 / 372
  • Number of attempts: 3
Java to JavaScript - 187 entries

Let convert some simple Java file to JavaScript!

  • Best score: 59
  • Best player score: 88
  • Position: #28 / 46
  • Number of attempts: 2
hello-world-vimgolf - 1657 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #108 / 475
  • Number of attempts: 4
Lowercase first characters - 370 entries

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

  • Best score: 33
  • Best player score: 35
  • Position: #42 / 133
  • Number of attempts: 3
Generate a very basic Python constructor - 279 entries

I actually needed to do this myself, so I look forward to learning how.

  • Best score: 38
  • Best player score: 38
  • Position: #8 / 79
  • Number of attempts: 9
Python dataclasses - 686 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 19
  • Position: #19 / 178
  • Number of attempts: 9
RUST Cargo.toml version to last - 245 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

  • Best score: 16
  • Best player score: 21
  • Position: #55 / 70
  • Number of attempts: 1
Making 3 line function a one liner. - 181 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #26 / 119
  • Number of attempts: 1
Modernise code - 931 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #33 / 208
  • Number of attempts: 10
Enumerate Bullets - 214 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

  • Best score: 20
  • Best player score: 20
  • Position: #16 / 56
  • Number of attempts: 10
swap number pairs - 1609 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #30 / 298
  • Number of attempts: 14
Extend shell script - 83 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 77
  • Position: #27 / 32
  • Number of attempts: 1
ssh config skills - 219 entries

Parse output from `kuebctl get no -o wide` into an .ssh/config file!

  • Best score: 41
  • Best player score: 41
  • Position: #7 / 54
  • Number of attempts: 8
Change double quotes to single quotes, but with a twist - 258 entries

Although this challenge is in the context of a Python function, you don't need to know Python to do this challenge. It is to add contexts and interesting constraints. The file contains a function that prints a multi-line string literal. I wrote the string literal with double quotes, but then I decided to use single quotes instead, and that's your challenge. However, interestingly enough, the string itself contains single and double quotes. This means, inside the string literal, the originally escaped double quotes no longer need to be escaped, but the single quotes now need to be escaped. Note that the triple double quotes in the docstring should be left alone.

  • Best score: 22
  • Best player score: 22
  • Position: #16 / 49
  • Number of attempts: 11
Python: Def to Lambda - 383 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #36 / 129
  • Number of attempts: 6
Satisfy the go linter - 2025 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: #104 / 408
  • Number of attempts: 6
Add quotes to ansible playbook - 795 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 8
  • Position: #45 / 250
  • Number of attempts: 4
Multiline to Single Line - 538 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #130 / 241
  • Number of attempts: 2
xrandr outputs and dashes - 607 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 12
  • Position: #114 / 195
  • Number of attempts: 3
Capitalize the Names - 322 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: #33 / 81
  • Number of attempts: 9
Yo To Hello - 1059 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #304 / 485
  • Number of attempts: 3
Hogwarts Email Sorting - 837 entries

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

  • Best score: 20
  • Best player score: 20
  • Position: #49 / 241
  • Number of attempts: 6
Reconstruct the actual output from my unit test tool report - 133 entries

When a test fails, my unit test tool reports differences between the actual output and the expected output as follow: - line in the expected output but missing in the actual output are prefixed with a dash - unexpected lines in the actual output are prefixed with a plus sign - comments added by the unit test tool are prefixed with a question mark - common lines are showed `as-is` (well, almost;) From that "diff" format, I would like to reconstruct the actual output.

  • Best score: 16
  • Best player score: 16
  • Position: #22 / 45
  • Number of attempts: 5
Swap values - 4482 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #348 / 1245
  • Number of attempts: 6
prepend * to every non-blank line - 6030 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #404 / 1477
  • Number of attempts: 7
Cool or not? - 761 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 15
  • Position: #66 / 216
  • Number of attempts: 10
From argument to object - 1433 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: 17
  • Position: #141 / 437
  • Number of attempts: 2
Extract argument from function - 2257 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #256 / 733
  • Number of attempts: 4
Just the middle - 11261 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1473 / 4135
  • Number of attempts: 4
Todo list specification - 368 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 37
  • Position: #87 / 169
  • Number of attempts: 5
Fiddle percentages into real numbers - 801 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: 13
  • Position: #150 / 274
  • Number of attempts: 5
JS notation to Immutable.js notation - 155 entries

Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.

  • Best score: 35
  • Best player score: 40
  • Position: #35 / 59
  • Number of attempts: 2
FoodCritic023: Prefer conditional attributes - 177 entries

FoodCritic (www.foodcritic.io) is a lint tool for your Chef (learn.chef.io) cookbooks. FC023 indicates that you should prefer Chef guards over Ruby conditions. This challenge expects you to be able to fix this issue in a sample cookbook, given the FoodCritic output: ================================================================ FC023: Prefer conditional attributes: cookbooks/foo/recipes/default.rb:25 ================================================================ See http://www.foodcritic.io/#FC023 for more details about the changes being made.

  • Best score: 25
  • Best player score: 25
  • Position: #6 / 50
  • Number of attempts: 9
comments galore - 970 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #293 / 410
  • Number of attempts: 2
Refactoring useless Method away - 91 entries

Real-life challenge, convert a bunch of ifs to a switch statement

  • Best score: 47
  • Best player score: 47
  • Position: #5 / 32
  • Number of attempts: 11
Do you demand a shrubbery? - 1107 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 31
  • Position: #214 / 292
  • Number of attempts: 2
Dehamlizing - 177 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 32
  • Position: #6 / 68
  • Number of attempts: 9
The Quick Brown Fox Jumps Over The Lazy Vim - 392 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 10
  • Position: #91 / 182
  • Number of attempts: 2
Saving the hashes(#) - 1973 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: 21
  • Position: #123 / 468
  • Number of attempts: 8
Inconsistent real estate paste - 176 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 24
  • Position: #9 / 53
  • Number of attempts: 7
Vertical Limit - 2383 entries

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

  • Best score: 21
  • Best player score: 21
  • Position: #93 / 721
  • Number of attempts: 5
Switch function arguments - 1995 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #180 / 631
  • Number of attempts: 5
Append semicolon after expressions - 968 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #129 / 391
  • Number of attempts: 4
Reverse and double space - 456 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #64 / 187
  • Number of attempts: 9
Remove noise from HTTP log - 666 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: 15
  • Position: #135 / 263
  • Number of attempts: 2
Remove semicolons after expressions - 576 entries

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

  • Best score: 6
  • Best player score: 7
  • Position: #135 / 244
  • Number of attempts: 3
HTML to Haml - 837 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 27
  • Position: #43 / 200
  • Number of attempts: 13
PEP8 Python Wrapping Comments and Code - 162 entries

According to PEP8, long flowy text and code should have different max line lengths. Code: 79 characters max Long flowy text: 72 characters max

  • Best score: 23
  • Best player score: 41
  • Position: #53 / 61
  • Number of attempts: 3
Get rid of html tags - 348 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 15
  • Best player score: 16
  • Position: #9 / 209
  • Number of attempts: 2
Arya Kumar
Twitter:

entered into 49 challenges

contributed 0 challenges