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 - 359 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: #60 / 128
  • Number of attempts: 5
simple replacements - 1072 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 23
  • Position: #129 / 239
  • Number of attempts: 8
Inverting Lines - 1296 entries

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

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 48
  • Position: #133 / 191
  • Number of attempts: 3
HS Final exam vimgolf - 666 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: #89 / 176
  • Number of attempts: 2
Change double quotes to single quotes, but with a twist - 248 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: #47 / 48
  • Number of attempts: 1
Python: Def to Lambda - 372 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 23
  • Position: #101 / 124
  • Number of attempts: 4
Multiline to Single Line - 522 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #98 / 235
  • Number of attempts: 3
From a Thunderlink to a Markdown link - 702 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 / 155
  • Number of attempts: 1
Yo To Hello - 1048 entries

Simply Turn Yo To Hello

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #681 / 1463
  • Number of attempts: 4
One number per line - 18377 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2524 / 3787
  • Number of attempts: 2
V to the i - 4639 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1455 / 1856
  • Number of attempts: 2
Add semicolons - 10539 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 14
  • Position: #2099 / 2988
  • Number of attempts: 1
Box it - 7680 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 48
  • Position: #1731 / 1835
  • 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 - 2215 entries

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

  • Best score: 13
  • Best player score: 23
  • Position: #709 / 728
  • Number of attempts: 1
Search and Replace 0 - 4651 entries

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

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

"vim vi improved"

  • Best score: 9
  • Best player score: 15
  • Position: #605 / 683
  • Number of attempts: 3
Just the middle - 11136 entries

Delete the instructions at the top and bottom.

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

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #313 / 570
  • 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 - 2093 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: #588 / 641
  • Number of attempts: 2
Delete to the end of the current line - 711 entries

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

  • Best score: 5
  • Best player score: 6
  • Position: #320 / 348
  • Number of attempts: 2
convert yml into java pojo field - 808 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: #150 / 215
  • Number of attempts: 1
-a-b-c- - 3118 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 18
  • Position: #1032 / 1112
  • 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 - 2367 entries

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

  • Best score: 21
  • Best player score: 29
  • Position: #617 / 716
  • Number of attempts: 3
switch variable - 4917 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 18
  • Position: #1610 / 1701
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 6014 entries

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

  • Best score: 32
  • Best player score: 68
  • Position: #1423 / 1481
  • 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