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

Paste a column after a column - 2661 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #121 / 575
  • Number of attempts: 8
Reformat symbols in list - 1648 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #104 / 354
  • Number of attempts: 18
delete swap - 1834 entries

delete all swap

  • Best score: 5
  • Best player score: 6
  • Position: #424 / 570
  • Number of attempts: 5
Put a newline after every 10 lines in vim - 1678 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #200 / 563
  • Number of attempts: 3
hello-world-vimgolf - 2522 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #422 / 721
  • Number of attempts: 3
simple replacements - 1857 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #141 / 398
  • Number of attempts: 7
Inverting Lines - 1946 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #220 / 520
  • Number of attempts: 1
Python dataclasses - 1237 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 19
  • Position: #66 / 309
  • Number of attempts: 7
Making 3 line function a one liner. - 343 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #169 / 211
  • Number of attempts: 1
Modernise code - 1429 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 35
  • Position: #101 / 329
  • Number of attempts: 7
swap number pairs - 2162 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #117 / 391
  • Number of attempts: 14
Python: Def to Lambda - 474 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #85 / 158
  • Number of attempts: 2
Rural Post - 4579 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #477 / 1117
  • Number of attempts: 3
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: #152 / 491
  • Number of attempts: 9
Add quotes to ansible playbook - 1031 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #203 / 326
  • Number of attempts: 5
Multiline to Single Line - 747 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #230 / 318
  • Number of attempts: 1
Yo To Hello - 1152 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #393 / 534
  • Number of attempts: 1
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: 11
  • Position: #761 / 1555
  • Number of attempts: 5
Quote modules - 1095 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 22
  • Position: #82 / 286
  • Number of attempts: 4
Unsemantic linewrapping - 934 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: 10
  • Position: #155 / 233
  • Number of attempts: 2
Add string initializers to an enum - 892 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 22
  • Position: #103 / 263
  • Number of attempts: 6
Add semicolons - 10916 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1779 / 3085
  • Number of attempts: 3
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: #222 / 536
  • Number of attempts: 6
Wrap the text of an email message to 79 characters - 848 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #294 / 439
  • Number of attempts: 4
ninja substitution - 1427 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 15
  • Position: #143 / 269
  • Number of attempts: 4
Join 'em - 252 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 4
  • Position: #22 / 152
  • Number of attempts: 1
Remove quotes after first field - 386 entries

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

  • Best score: 16
  • Best player score: 18
  • Position: #46 / 93
  • Number of attempts: 9
Reorder the groups - 1185 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #125 / 266
  • Number of attempts: 8
Reverse and count - 486 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 18
  • Position: #17 / 179
  • Number of attempts: 13
EtherFan
Twitter2:

Diving deep with eth

entered into 29 challenges

contributed 0 challenges