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

Tabbed Table to Python Array - 75 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 52
  • Best player score: 66
  • Position: #23 / 27
  • Number of attempts: 2
HS exam question - 763 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 72
  • Position: #107 / 199
  • Number of attempts: 3
Reformat symbols in list - 636 entries

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

  • Best score: 24
  • Best player score: 38
  • Position: #108 / 146
  • Number of attempts: 2
Fizzbuzz - 235 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 71
  • Position: #35 / 72
  • Number of attempts: 1
Poorly indented Python comments - 744 entries

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

  • Best score: 15
  • Best player score: 22
  • Position: #49 / 141
  • Number of attempts: 3
Many duplicates - 589 entries

Quick and easy

  • Best score: 7
  • Best player score: 10
  • Position: #171 / 207
  • Number of attempts: 2
2 quick changes and a numbered list - 352 entries

The ascii will not be lost, but rather numbered in 4 digit blocks with leading zeros.

  • Best score: 37
  • Best player score: 52
  • Position: #56 / 87
  • Number of attempts: 3
delete swap - 734 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #25 / 250
  • Number of attempts: 4
Fix the shell script! - 1377 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 36
  • Position: #207 / 343
  • Number of attempts: 2
Visual block training - 630 entries

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

  • Best score: 17
  • Best player score: 36
  • Position: #66 / 121
  • Number of attempts: 3
Put a newline after every 10 lines in vim - 1163 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #257 / 401
  • Number of attempts: 3
Wikitext headings to markdown - 709 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 21
  • Position: #46 / 157
  • Number of attempts: 1
hello-world-vimgolf - 1758 entries

Simple number generation

  • Best score: 10
  • Best player score: 14
  • Position: #390 / 505
  • Number of attempts: 1
Plotting some variables in python - 1264 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: 45
  • Position: #128 / 268
  • Number of attempts: 1
Lowercase first characters - 387 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: 60
  • Position: #132 / 142
  • Number of attempts: 1
Inverting Lines - 1436 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #179 / 395
  • Number of attempts: 2
Modernise code - 983 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 44
  • Position: #133 / 223
  • Number of attempts: 1
Put a cross in the square - 143 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 23
  • Position: #49 / 62
  • Number of attempts: 2
HS Final exam vimgolf - 745 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: #107 / 200
  • Number of attempts: 3
Easy modification of ssh config - 263 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 28
  • Position: #47 / 84
  • Number of attempts: 2
Rural Post - 4156 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #610 / 1030
  • Number of attempts: 1
Satisfy the go linter - 2031 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: 27
  • Position: #277 / 412
  • Number of attempts: 2
Add quotes to ansible playbook - 822 entries

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

  • Best score: 8
  • Best player score: 10
  • Position: #216 / 258
  • Number of attempts: 1
Multiline to Single Line - 552 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #214 / 248
  • Number of attempts: 2
xrandr outputs and dashes - 613 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: #135 / 199
  • Number of attempts: 1
Replace pattern with 1, 2, 3, ... on each line - 1047 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: 31
  • Position: #146 / 211
  • Number of attempts: 1
Unsemantic linewrapping - 849 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

  • Best score: 9
  • Best player score: 11
  • Position: #157 / 215
  • Number of attempts: 3
Add string initializers to an enum - 802 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 28
  • Position: #206 / 240
  • Number of attempts: 1
Bad Copy Syntax - 1951 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #262 / 497
  • Number of attempts: 2
Tables, Functions, Sprocs - 121 entries

In order to load some scripts into my database in the correct order I need to load tables first (t_), then functions (fn_), then stored procedures (sp_). The order of the t_ lines and the order of the sp_ lines should also match. Reorder the lines so they will load correctly.

  • Best score: 10
  • Best player score: 13
  • Position: #40 / 42
  • Number of attempts: 2
Hash staircase - 41 entries

Can you use a strategy to come up with this pattern?

  • Best score: 21
  • Best player score: 23
  • Position: #20 / 20
  • Number of attempts: 2
Around the clock - 183 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: 16
  • Position: #63 / 71
  • Number of attempts: 1
Join 'em - 234 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 6
  • Position: #132 / 139
  • Number of attempts: 1
change parenthesis - 260 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 10
  • Position: #137 / 147
  • Number of attempts: 2
Label grid cells (6x6) - 34 entries

Label the cells of a grid with its coordinates. Rows are labelled top to bottom from A to F, and columns left to right from A to F. Each cell has a coordinate MN, where M is the row letter and N is the column letter.

  • Best score: 31
  • Best player score: 61
  • Position: #14 / 15
  • Number of attempts: 3
Remove quotes after first field - 331 entries

Remove the quotes around each field except for the first field.

  • Best score: 16
  • Best player score: 25
  • Position: #62 / 82
  • Number of attempts: 1
Alphabet soup - 396 entries

Create a column of all alphabet characters organized in a funky way

  • Best score: 25
  • Best player score: 41
  • Position: #79 / 96
  • Number of attempts: 2
steve
Twitter:

entered into 37 challenges

contributed 0 challenges