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

delete swap - 1818 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #157 / 567
  • Number of attempts: 2
Visual block training - 1096 entries

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

  • Best score: 17
  • Best player score: 18
  • Position: #18 / 207
  • Number of attempts: 17
Put a newline after every 10 lines in vim - 1668 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #124 / 561
  • Number of attempts: 4
hello-world-vimgolf - 2513 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #13 / 717
  • Number of attempts: 3
simple replacements - 1833 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 19
  • Position: #32 / 396
  • Number of attempts: 10
Inverting Lines - 1932 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #254 / 518
  • Number of attempts: 5
Python dataclasses - 1229 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 19
  • Position: #36 / 308
  • Number of attempts: 8
RUST Cargo.toml version to last - 378 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #48 / 104
  • Number of attempts: 6
Modernise code - 1420 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #48 / 328
  • Number of attempts: 7
swap number pairs - 2146 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #36 / 390
  • Number of attempts: 15
Rural Post - 4572 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #168 / 1116
  • Number of attempts: 5
Satisfy the go linter - 2468 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: #110 / 491
  • Number of attempts: 7
Add quotes to ansible playbook - 1030 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #50 / 325
  • Number of attempts: 5
xrandr outputs and dashes - 725 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: #121 / 226
  • Number of attempts: 4
From a Thunderlink to a Markdown link - 783 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: 18
  • Position: #50 / 174
  • Number of attempts: 8
Yo To Hello - 1152 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 11
  • Position: #452 / 534
  • Number of attempts: 2
Replace pattern with 1, 2, 3, ... on each line - 1151 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

  • Best score: 21
  • Best player score: 21
  • Position: #39 / 233
  • Number of attempts: 16
Get mail address from outlook format - 649 entries

Create a mail list space separated of mail list formatted by outlook

  • Best score: 15
  • Best player score: 15
  • Position: #70 / 204
  • Number of attempts: 3
prepend * to every non-blank line - 6366 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #411 / 1555
  • Number of attempts: 8
Applying same text modification in several lines - 2915 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 12
  • Position: #9 / 863
  • Number of attempts: 3
Add string initializers to an enum - 892 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 21
  • Position: #63 / 263
  • Number of attempts: 7
SCREAMING_SNAKE_CASE to Title Case - 1253 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

  • Best score: 19
  • Best player score: 20
  • Position: #115 / 261
  • Number of attempts: 6
Add semicolons - 10916 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 14
  • Position: #2186 / 3085
  • Number of attempts: 1
Bad Copy Syntax - 2055 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 19
  • Position: #210 / 536
  • Number of attempts: 3
remove lines containing the word "reader" - 3622 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #480 / 1177
  • Number of attempts: 4
Box it - 7962 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #439 / 1891
  • Number of attempts: 6
multiple cursor alternative - 1547 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 19
  • Position: #92 / 385
  • Number of attempts: 7
Array propagate - 343 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 24
  • Position: #45 / 121
  • Number of attempts: 5
Search and Replace 0 - 5027 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #1078 / 1637
  • Number of attempts: 3
ninja substitution - 1427 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Position: #77 / 269
  • Number of attempts: 10
One to Ten - 2241 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: 12
  • Position: #340 / 682
  • Number of attempts: 1
Change part of a function name in multiple occurrences - 672 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

  • Best score: 14
  • Best player score: 14
  • Position: #63 / 210
  • Number of attempts: 3
Line under headers - 2072 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 38
  • Position: #430 / 510
  • Number of attempts: 1
Around the clock - 199 entries

You'll want to use 2 special commands to complete this. If you haven't yet, read through 'input.txt', especially :help simple-changes

  • Best score: 13
  • Best player score: 13
  • Position: #34 / 77
  • Number of attempts: 5
Join 'em - 252 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 5
  • Position: #134 / 152
  • Number of attempts: 1
Reorder the groups - 1185 entries

Change the order so that the groups of fruit come before the vegetables.

  • Best score: 14
  • Best player score: 14
  • Position: #87 / 266
  • Number of attempts: 7
move titles next to url, in quotes - 551 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 20
  • Position: #28 / 146
  • Number of attempts: 4
Array transposition - 2436 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 16
  • Position: #41 / 452
  • Number of attempts: 13
Reformat most common surnames - 782 entries

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

  • Best score: 23
  • Best player score: 24
  • Position: #26 / 227
  • Number of attempts: 5
Get rid of html tags - 423 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #14 / 245
  • Number of attempts: 2
Sort and add attributes - 1539 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 33
  • Position: #240 / 594
  • Number of attempts: 4
Reconstruct the Sentence - 1677 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 21
  • Position: #257 / 440
  • Number of attempts: 5
Braces or Brackets? - 1096 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 34
  • Position: #24 / 339
  • Number of attempts: 11
Whitespace, empty lines and tabs - 3852 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #153 / 829
  • Number of attempts: 9
Simple text editing with Vim - 13262 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1941 / 3810
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 7389 entries

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

  • Best score: 7
  • Best player score: 37
  • Position: #588 / 1825
  • Number of attempts: 4
yancy
Twitter:

233

entered into 46 challenges

contributed 0 challenges