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 - 1578 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #53 / 525
  • Number of attempts: 3
Java to JavaScript - 257 entries

Let convert some simple Java file to JavaScript!

  • Best score: 59
  • Best player score: 88
  • Position: #36 / 67
  • Number of attempts: 2
hello-world-vimgolf - 2361 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #108 / 667
  • Number of attempts: 4
Lowercase first characters - 467 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: #53 / 175
  • Number of attempts: 3
Generate a very basic Python constructor - 309 entries

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

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

Simple challenge to extract fields from a Python class

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

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

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #33 / 308
  • Number of attempts: 10
Enumerate Bullets - 292 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 / 80
  • Number of attempts: 10
swap number pairs - 2011 entries

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

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

Just add some more stuff

  • Best score: 37
  • Best player score: 77
  • Position: #34 / 42
  • Number of attempts: 1
ssh config skills - 249 entries

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

  • Best score: 41
  • Best player score: 41
  • Position: #7 / 63
  • Number of attempts: 8
Change double quotes to single quotes, but with a twist - 281 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 / 53
  • Number of attempts: 11
Python: Def to Lambda - 423 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #36 / 149
  • Number of attempts: 6
Satisfy the go linter - 2329 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 / 457
  • Number of attempts: 6
Add quotes to ansible playbook - 930 entries

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

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

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

  • Best score: 5
  • Best player score: 5
  • Position: #130 / 292
  • Number of attempts: 2
xrandr outputs and dashes - 652 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 / 213
  • Number of attempts: 3
Capitalize the Names - 361 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 / 91
  • Number of attempts: 9
Yo To Hello - 1115 entries

Simply Turn Yo To Hello

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

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

  • Best score: 20
  • Best player score: 20
  • Position: #49 / 254
  • Number of attempts: 6
Reconstruct the actual output from my unit test tool report - 151 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 / 51
  • Number of attempts: 5
Swap values - 4543 entries

Well, swap the values...

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

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

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

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 15
  • Position: #66 / 226
  • Number of attempts: 10
From argument to object - 1474 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 / 450
  • Number of attempts: 2
Extract argument from function - 2314 entries

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

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

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1472 / 4164
  • Number of attempts: 4
Todo list specification - 385 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 / 176
  • Number of attempts: 5
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: 13
  • Position: #150 / 287
  • Number of attempts: 5
JS notation to Immutable.js notation - 161 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: 34
  • Best player score: 40
  • Position: #36 / 60
  • Number of attempts: 2
FoodCritic023: Prefer conditional attributes - 178 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 / 51
  • Number of attempts: 9
comments galore - 998 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #293 / 418
  • 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? - 1120 entries

Use :redir and crush the emacsgolfers.

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

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 32
  • Position: #6 / 69
  • Number of attempts: 9
The Quick Brown Fox Jumps Over The Lazy Vim - 401 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: #92 / 188
  • Number of attempts: 2
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: 21
  • Position: #123 / 473
  • Number of attempts: 8
Inconsistent real estate paste - 184 entries

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

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

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

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

How to switch two arguments of a function.

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

Some lines need the semicolon, some don't.

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

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #64 / 194
  • Number of attempts: 9
Remove noise from HTTP log - 695 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 / 270
  • Number of attempts: 2
Remove semicolons after expressions - 628 entries

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

  • Best score: 6
  • Best player score: 7
  • Position: #140 / 258
  • Number of attempts: 3
HTML to Haml - 842 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 27
  • Position: #43 / 202
  • Number of attempts: 13
PEP8 Python Wrapping Comments and Code - 187 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: #57 / 64
  • Number of attempts: 3
Get rid of html tags - 368 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 / 217
  • Number of attempts: 2
Arya Kumar
Twitter:

entered into 49 challenges

contributed 0 challenges