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

Lowercase first characters - 366 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: 39
  • Position: #62 / 131
  • Number of attempts: 5
simple replacements - 1115 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 23
  • Position: #132 / 247
  • Number of attempts: 8
Inverting Lines - 1333 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #60 / 372
  • Number of attempts: 1
Modernise code - 885 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 48
  • Position: #140 / 200
  • Number of attempts: 3
HS Final exam vimgolf - 685 entries

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

  • Best score: 21
  • Best player score: 27
  • Position: #92 / 183
  • Number of attempts: 2
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: 54
  • Position: #48 / 49
  • Number of attempts: 1
Python: Def to Lambda - 378 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 23
  • Position: #103 / 126
  • Number of attempts: 4
Multiline to Single Line - 525 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #98 / 237
  • Number of attempts: 3
From a Thunderlink to a Markdown link - 703 entries

ThunderLinks are durable hyperlinks to specific email messages generated from Thunderbird in HTML format. Leverage the power of vim to make them suitable for a markdown-formatted file.

  • Best score: 18
  • Best player score: 27
  • Position: #128 / 156
  • Number of attempts: 1
Yo To Hello - 1051 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #288 / 483
  • Number of attempts: 3
prepend * to every non-blank line - 5977 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #682 / 1468
  • Number of attempts: 4
One number per line - 18395 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2527 / 3793
  • Number of attempts: 2
V to the i - 4641 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1456 / 1857
  • Number of attempts: 2
Add semicolons - 10545 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 14
  • Position: #2100 / 2989
  • Number of attempts: 1
Box it - 7682 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 48
  • Position: #1732 / 1836
  • Number of attempts: 2
From argument to object - 1262 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: 22
  • Position: #363 / 417
  • Number of attempts: 1
Every other line - 2829 entries

AaAaAaA

  • Best score: 12
  • Best player score: 21
  • Position: #626 / 686
  • Number of attempts: 1
Extract argument from function - 2218 entries

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

  • Best score: 13
  • Best player score: 23
  • Position: #710 / 729
  • Number of attempts: 1
Search and Replace 0 - 4681 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #662 / 1550
  • Number of attempts: 4
That hyphen - 2507 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #606 / 684
  • Number of attempts: 3
Just the middle - 11141 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1461 / 4114
  • Number of attempts: 3
Team names - 1780 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #313 / 571
  • Number of attempts: 3
Adam's challenge - 916 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 28
  • Position: #242 / 257
  • Number of attempts: 1
One to Ten - 2095 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 23
  • Position: #589 / 642
  • Number of attempts: 2
Delete to the end of the current line - 713 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 6
  • Position: #321 / 349
  • Number of attempts: 2
convert yml into java pojo field - 818 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

  • Best score: 29
  • Best player score: 32
  • Position: #152 / 217
  • Number of attempts: 1
-a-b-c- - 3122 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 18
  • Position: #1033 / 1113
  • Number of attempts: 1
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2717 / 3919
  • Number of attempts: 1
Vertical Limit - 2377 entries

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

  • Best score: 21
  • Best player score: 29
  • Position: #619 / 719
  • Number of attempts: 3
switch variable - 4945 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 18
  • Position: #1617 / 1708
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 6033 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 68
  • Position: #1428 / 1486
  • Number of attempts: 2
kafang plays vimgolf
Twitter:

I used this account for vimgolf, maybe I am going to follow some people now and then

entered into 31 challenges

contributed 0 challenges