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 - 2537 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #114 / 553
  • Number of attempts: 8
Reformat symbols in list - 1621 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #103 / 348
  • Number of attempts: 18
delete swap - 1786 entries

delete all swap

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #199 / 556
  • Number of attempts: 3
hello-world-vimgolf - 2499 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #415 / 708
  • Number of attempts: 3
simple replacements - 1753 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #138 / 380
  • Number of attempts: 7
Inverting Lines - 1900 entries

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

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

Simple challenge to extract fields from a Python class

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 35
  • Position: #98 / 323
  • Number of attempts: 7
swap number pairs - 2103 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #115 / 380
  • Number of attempts: 14
Python: Def to Lambda - 455 entries

LAMBDA!!!

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

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

  • Best score: 9
  • Best player score: 10
  • Position: #473 / 1097
  • Number of attempts: 3
Satisfy the go linter - 2391 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 / 471
  • Number of attempts: 9
Add quotes to ansible playbook - 954 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #199 / 305
  • Number of attempts: 5
Multiline to Single Line - 703 entries

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

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

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #392 / 524
  • Number of attempts: 1
prepend * to every non-blank line - 6312 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #758 / 1537
  • Number of attempts: 5
Quote modules - 1084 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 22
  • Position: #82 / 281
  • Number of attempts: 4
Unsemantic linewrapping - 928 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: #154 / 231
  • Number of attempts: 2
Add string initializers to an enum - 872 entries

Change Typescript enum so that it has string initializers.

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

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1771 / 3063
  • Number of attempts: 3
Bad Copy Syntax - 2037 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #222 / 525
  • Number of attempts: 6
Wrap the text of an email message to 79 characters - 766 entries

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

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

How can you reuse a previous substitution ?

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

This shouldn't be too tough

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

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

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

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

  • Best score: 14
  • Best player score: 15
  • Position: #125 / 264
  • Number of attempts: 8
Reverse and count - 473 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 / 176
  • Number of attempts: 13
EtherFan
Twitter2:

Diving deep with eth

entered into 29 challenges

contributed 0 challenges