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 - 2668 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 / 578
  • Number of attempts: 8
Reformat symbols in list - 1658 entries

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

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

delete all swap

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #201 / 567
  • Number of attempts: 3
hello-world-vimgolf - 2533 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #425 / 726
  • Number of attempts: 3
simple replacements - 1884 entries

The goal is to see the replacement commands in action.

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

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

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

Simple challenge to extract fields from a Python class

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

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

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

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

LAMBDA!!!

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

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

  • Best score: 9
  • Best player score: 10
  • Position: #479 / 1124
  • Number of attempts: 3
Satisfy the go linter - 2487 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 / 496
  • Number of attempts: 9
Add quotes to ansible playbook - 1049 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #205 / 332
  • Number of attempts: 5
Multiline to Single Line - 754 entries

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

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

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #393 / 537
  • Number of attempts: 1
prepend * to every non-blank line - 6397 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #764 / 1563
  • Number of attempts: 5
Quote modules - 1104 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 22
  • Position: #83 / 291
  • Number of attempts: 4
Unsemantic linewrapping - 964 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: #157 / 238
  • Number of attempts: 2
Add string initializers to an enum - 903 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 22
  • Position: #104 / 266
  • Number of attempts: 6
Add semicolons - 10956 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1785 / 3098
  • Number of attempts: 3
Bad Copy Syntax - 2088 entries

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

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

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

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

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 15
  • Position: #144 / 271
  • Number of attempts: 4
Join 'em - 258 entries

This shouldn't be too tough

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

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

  • Best score: 16
  • Best player score: 18
  • Position: #47 / 96
  • Number of attempts: 9
Reorder the groups - 1201 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #127 / 270
  • Number of attempts: 8
Reverse and count - 501 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 / 181
  • Number of attempts: 13
EtherFan
Twitter2:

Diving deep with eth

entered into 29 challenges

contributed 0 challenges