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

HS exam question - 1599 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 60
  • Position: #121 / 419
  • Number of attempts: 4
Reformat symbols in list - 1635 entries

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

  • Best score: 24
  • Best player score: 38
  • Position: #255 / 352
  • Number of attempts: 1
Poorly indented Python comments - 1328 entries

Fix the alignment of some Python comments as quickly as possible.

  • Best score: 15
  • Best player score: 15
  • Position: #11 / 223
  • Number of attempts: 9
Many duplicates - 1460 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #99 / 477
  • Number of attempts: 2
delete swap - 1815 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #52 / 566
  • Number of attempts: 2
Generate a very basic Python constructor (fixed) - 1281 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 29
  • Position: #37 / 275
  • Number of attempts: 15
Visual block training - 1096 entries

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

  • Best score: 17
  • Best player score: 52
  • Position: #146 / 207
  • Number of attempts: 2
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: 13
  • Position: #351 / 561
  • Number of attempts: 1
hello-world-vimgolf - 2510 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #149 / 716
  • Number of attempts: 3
Fill in the chess board - 959 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 48
  • Position: #136 / 185
  • Number of attempts: 3
Learn to ask for :help - 587 entries

Learn to use the help to reduce your strokes...

  • Best score: 19
  • Best player score: 44
  • Position: #109 / 130
  • Number of attempts: 1
Plotting some variables in python - 1673 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 47
  • Position: #184 / 350
  • Number of attempts: 2
simple replacements - 1833 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #132 / 396
  • Number of attempts: 6
Python dataclasses - 1229 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 29
  • Position: #201 / 308
  • Number of attempts: 2
Making 3 line function a one liner. - 340 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 2084
  • Position: #209 / 209
  • Number of attempts: 1
swap number pairs - 2146 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #46 / 390
  • Number of attempts: 16
ssh config skills - 258 entries

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

  • Best score: 41
  • Best player score: 62
  • Position: #41 / 66
  • Number of attempts: 1
Python: Def to Lambda - 460 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 20
  • Position: #105 / 157
  • Number of attempts: 1
Turn the x - 328 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 29
  • Position: #79 / 82
  • Number of attempts: 1
Levenshtein distance - 105 entries

Compute distance for each pair. Notice that this recursive implementation is very inefficient. Wagner-Fischer algorithm is iterative and much faster. #vimscript

  • Best score: 27
  • Best player score: 37
  • Position: #23 / 37
  • Number of attempts: 1
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: 28
  • Position: #360 / 491
  • Number of attempts: 1
Yo To Hello - 1152 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 232
  • Position: #534 / 534
  • Number of attempts: 1
Simple, Practical, and Common - 33843 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 24
  • Position: #3118 / 7469
  • Number of attempts: 6
Hogwarts Email Sorting - 944 entries

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

  • Best score: 20
  • Best player score: 52
  • Position: #260 / 267
  • Number of attempts: 1
citizen_hacks_2019_challenge2 - 202 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 8
  • Position: #102 / 104
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 842 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #278 / 436
  • Number of attempts: 2
Preferably without multi-cursor plugin - 549 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 30
  • Position: #22 / 132
  • Number of attempts: 8
Simple Maths - 57 entries

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 1000
  • Position: #27 / 27
  • Number of attempts: 1
Words in parens - 12991 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 13
  • Position: #10 / 3976
  • Number of attempts: 5
A simple change - 476 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 12
  • Position: #48 / 196
  • Number of attempts: 2
Switch function arguments - 2182 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #523 / 674
  • Number of attempts: 1
un-C-escape string - 58 entries

Convert escape sequences to characters

  • Best score: 12
  • Best player score: 12
  • Position: #47 / 52
  • Number of attempts: 1
imports alignment (python) - 700 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 45
  • Position: #189 / 198
  • Number of attempts: 1
A Simple One - 1067 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #553 / 671
  • Number of attempts: 1
Table Reshuffle - 450 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 40
  • Position: #119 / 144
  • Number of attempts: 3
Change the content of a string - 1707 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #204 / 628
  • Number of attempts: 3
Sort and add attributes - 1534 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #252 / 593
  • Number of attempts: 3
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: 20
  • Position: #130 / 440
  • Number of attempts: 12
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: #28 / 339
  • Number of attempts: 9
Whitespace, empty lines and tabs - 3843 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #158 / 828
  • Number of attempts: 6
Flodder-challenge - 1401 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 27
  • Position: #23 / 358
  • Number of attempts: 9
Simple text editing with Vim - 13251 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1955 / 3806
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 7369 entries

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

  • Best score: 7
  • Best player score: 40
  • Position: #873 / 1821
  • Number of attempts: 4

Contributed Challenges

Visual block training - 1096 entries

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

math is what I hate
Twitter:

entered into 43 challenges

contributed 1 challenges