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

Find fix point of cos - 1204 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 15
  • Position: #112 / 365
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 507 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #86 / 287
  • Number of attempts: 1
Paste a column after a column - 2413 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 16
  • Position: #159 / 523
  • Number of attempts: 9
HS exam question - 1523 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 90
  • Position: #297 / 404
  • Number of attempts: 1
Reformat symbols in list - 1507 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #95 / 334
  • Number of attempts: 5
Substraction (bis) - 582 entries

Solve the equations (adapted from the original @Caek_'s challenge).

  • Best score: 21
  • Best player score: 23
  • Position: #33 / 110
  • Number of attempts: 13
Poorly indented Python comments - 1275 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #58 / 213
  • Number of attempts: 20
Many duplicates - 1350 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #223 / 440
  • Number of attempts: 4
2 quick changes and a numbered list - 615 entries

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

  • Best score: 37
  • Best player score: 37
  • Position: #25 / 148
  • Number of attempts: 11
delete swap - 1650 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #243 / 514
  • Number of attempts: 9
Generate a very basic Python constructor (fixed) - 1231 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: #49 / 260
  • Number of attempts: 12
Fix the shell script! - 2431 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 27
  • Position: #111 / 569
  • Number of attempts: 7
Visual block training - 1047 entries

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

  • Best score: 17
  • Best player score: 28
  • Position: #80 / 195
  • Number of attempts: 14
Put a newline after every 10 lines in vim - 1649 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #175 / 551
  • Number of attempts: 3
Wikitext headings to markdown - 985 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 21
  • Position: #66 / 207
  • Number of attempts: 17
hello-world-vimgolf - 2472 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #405 / 699
  • Number of attempts: 5
Contribute to keyboard mashing - 880 entries

Speak in tongues

  • Best score: 17
  • Best player score: 18
  • Position: #103 / 268
  • Number of attempts: 3
Fill in the chess board - 933 entries

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

  • Best score: 19
  • Best player score: 20
  • Position: #48 / 180
  • Number of attempts: 13
Plotting some variables in python - 1605 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: 36
  • Position: #90 / 345
  • Number of attempts: 4
Transpose a python matrix - 848 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 24
  • Position: #36 / 135
  • Number of attempts: 17
Increment number for every 10 lines - 229 entries

The file consists of 2 columns (code and percentage). We need to add 2 more columns with increasing number for 4th column (Xcols) and increment 3rd column (Ycols) only for every 10 lines with reset of 4th column

  • Best score: 25
  • Best player score: 28
  • Position: #23 / 63
  • Number of attempts: 9
simple replacements - 1710 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #134 / 378
  • Number of attempts: 6
Inverting Lines - 1870 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #191 / 505
  • Number of attempts: 3
Python dataclasses - 1121 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 20
  • Position: #106 / 281
  • Number of attempts: 4
RUST Cargo.toml version to last - 332 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #52 / 99
  • Number of attempts: 5
Making 3 line function a one liner. - 312 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #152 / 200
  • Number of attempts: 1
Modernise code - 1368 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 35
  • Position: #94 / 316
  • Number of attempts: 6
Staircase - 146 entries

Going downstairs, while singing the alphabet song. Some vb practice to us all. Would it be much easier to make it go from left to right instead?

  • Best score: 21
  • Best player score: 22
  • Position: #8 / 33
  • Number of attempts: 14
Enumerate Bullets - 309 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

  • Best score: 20
  • Best player score: 24
  • Position: #48 / 83
  • Number of attempts: 5
Put a cross in the square - 210 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 21
  • Position: #18 / 87
  • Number of attempts: 4
swap number pairs - 2023 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #113 / 373
  • Number of attempts: 9
HS Final exam vimgolf - 892 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #84 / 234
  • Number of attempts: 7
Easy modification of ssh config - 348 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 25
  • Position: #40 / 108
  • Number of attempts: 7
Change double quotes to single quotes, but with a twist - 291 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: 23
  • Position: #26 / 55
  • Number of attempts: 9
Turn the x - 317 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 20
  • Position: #38 / 80
  • Number of attempts: 8
Rural Post - 4427 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #466 / 1086
  • Number of attempts: 1
Satisfy the go linter - 2360 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: 21
  • Position: #195 / 465
  • Number of attempts: 9
Add quotes to ansible playbook - 946 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #197 / 302
  • Number of attempts: 2
xrandr outputs and dashes - 671 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: 13
  • Position: #167 / 218
  • Number of attempts: 1
From a Thunderlink to a Markdown link - 757 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: 19
  • Position: #71 / 168
  • Number of attempts: 6
Capitalize the Names - 382 entries

I want to capitalize the names in quotes, but just the people's names, not the file names.

  • Best score: 21
  • Best player score: 31
  • Position: #66 / 95
  • Number of attempts: 4
Replace pattern with 1, 2, 3, ... on each line - 1114 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: 22
  • Position: #89 / 228
  • Number of attempts: 11
Hogwarts Email Sorting - 891 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #105 / 257
  • Number of attempts: 7
Get mail address from outlook format - 642 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #126 / 202
  • Number of attempts: 4
Reconstruct the actual output from my unit test tool report - 152 entries

When a test fails, my unit test tool reports differences between the actual output and the expected output as follow: - line in the expected output but missing in the actual output are prefixed with a dash - unexpected lines in the actual output are prefixed with a plus sign - comments added by the unit test tool are prefixed with a question mark - common lines are showed `as-is` (well, almost;) From that "diff" format, I would like to reconstruct the actual output.

  • Best score: 16
  • Best player score: 17
  • Position: #38 / 52
  • Number of attempts: 7
Add text at some column - 162 entries

Complete golang struct statement.

  • Best score: 31
  • Best player score: 32
  • Position: #38 / 63
  • Number of attempts: 1
prepend * to every non-blank line - 6254 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #436 / 1530
  • Number of attempts: 4
Right Align Part of the line - 133 entries

The challenge is to right align a part of the line - this is useful in some SQL queries where it's more clear which are the fields displayed

  • Best score: 19
  • Best player score: 22
  • Position: #31 / 42
  • Number of attempts: 5
Quote modules - 1066 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 21
  • Position: #40 / 278
  • Number of attempts: 3
Aliases for cd - 877 entries

Create these beautiful aliases with as few strokes as possible. Are you up for the challenge?

  • Best score: 30
  • Best player score: 30
  • Position: #19 / 154
  • Number of attempts: 15
Quote modules (ver.2) - 225 entries

Complete golang import statement.

  • Best score: 22
  • Best player score: 23
  • Position: #27 / 59
  • Number of attempts: 5
Refactor typescript arrow function type - 307 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 21
  • Position: #32 / 70
  • Number of attempts: 5
SCREAMING_SNAKE_CASE to Title Case - 1203 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: #120 / 247
  • Number of attempts: 8
Triangle of arrows - 181 entries

I made this by accident when working on another challenge. How would you go about making this?

  • Best score: 14
  • Best player score: 16
  • Position: #18 / 43
  • Number of attempts: 14
Line under headers - 2023 entries

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

  • Best score: 24
  • Best player score: 36
  • Position: #396 / 498
  • Number of attempts: 1
Alphabet soup - 425 entries

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

  • Best score: 25
  • Best player score: 25
  • Position: #17 / 106
  • Number of attempts: 5
naka
Twitter2:

entered into 56 challenges

contributed 0 challenges