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

Filling braces - 481 entries

Inspired by a question on CoDidact (https://software.codidact.com/posts/296501), I wondered if Vim could offer a satisfactory ‘solution’ to this problem.

  • Best score: 21
  • Best player score: 24
  • Position: #22 / 157
  • Number of attempts: 3
Even and Odd - 393 entries

separate the even numbers from the odd numbers

  • Best score: 13
  • Best player score: 14
  • Position: #30 / 101
  • Number of attempts: 3
Modifying .XCompose - 104 entries

You just wrote some lines in .XCompose, but now you want the compose sequences to be more verbose. Change the compose sequence for each Greek letter to its name.

  • Best score: 33
  • Best player score: 38
  • Position: #19 / 28
  • Number of attempts: 4
hexagram binary tree - 128 entries

generate the binary tree that represents all possible hexagrams found in the book of changes (易经)

  • Best score: 23
  • Best player score: 28
  • Position: #10 / 30
  • Number of attempts: 4
Swap function parameters and delete all comments in python. - 1078 entries

Swap function parameters and delete all comments in python.

  • Best score: 19
  • Best player score: 21
  • Position: #86 / 263
  • Number of attempts: 6
Delete the last function argument in python. - 729 entries

Delete the last function argument in this python script.

  • Best score: 6
  • Best player score: 6
  • Position: #84 / 261
  • Number of attempts: 1
Flip All Bits - 503 entries

Perform a bitwise NOT operation on each bit, meaning that bits that are 0 become 1, and those that are 1 become 0.

  • Best score: 24
  • Best player score: 32
  • Position: #27 / 144
  • Number of attempts: 6
Find the devices that have no revoked time, and extract out the duration left on their leases. - 255 entries

Extract non-revoked devices and the duration of their leases.

  • Best score: 49
  • Best player score: 62
  • Position: #23 / 60
  • Number of attempts: 7
Convert list of enums to list of localization terms - 262 entries

While making my game Piloteer, I had a large list of TaskTypes and needed to convert them to an equivalent list of localization terms, to be used when translating the game's text into different languages.

  • Best score: 75
  • Best player score: 100
  • Position: #23 / 74
  • Number of attempts: 3
From brakets to parens - 1356 entries

This is one of the most common problem when you wrap an array for error handling. Vim is useful when you convert foo[i][j][k] into foo(i, j, k) for many times.

  • Best score: 24
  • Best player score: 27
  • Position: #99 / 309
  • Number of attempts: 9
π - 344 entries

1200 π chars

  • Best score: 16
  • Best player score: 21
  • Position: #47 / 84
  • Number of attempts: 5
Create json from a .env file - 1773 entries

A simple everyday task.

  • Best score: 38
  • Best player score: 41
  • Position: #65 / 431
  • Number of attempts: 4
Reordering properties - 1385 entries

Arrange the CSS lines for the #topbar selector based on their complete line length, from shortest to longest.

  • Best score: 24
  • Best player score: 29
  • Position: #22 / 302
  • Number of attempts: 4
Sort and Tag - 738 entries

The goal is to sort these lines alphabetically, assign a unique identifier to each line in the format "[01]", "[02]", etc., and then restore the original order of the lines while preserving the assigned identifiers.

  • Best score: 36
  • Best player score: 53
  • Position: #39 / 157
  • Number of attempts: 4
Changing date formats - 774 entries

Change the date format to Y/M/D.

  • Best score: 36
  • Best player score: 70
  • Position: #91 / 213
  • Number of attempts: 2
Swap columns and transform to CSV format - 516 entries

Turn this spreadsheet output into a CSV file but first swap the columns

  • Best score: 16
  • Best player score: 16
  • Position: #12 / 184
  • Number of attempts: 5
CaN yOuR ViM dO ThAt? #1 - 309 entries

Tsoding's famous "Can your Vim do that?" https://youtu.be/Bafo3hhheHU?si=DfcT4sUEMTSAevnx&t=1091

  • Best score: 41
  • Best player score: 46
  • Position: #73 / 123
  • Number of attempts: 1
Markdown Blog Editing - 488 entries

Convert the given link text in start file to a markdown link list.

  • Best score: 30
  • Best player score: 37
  • Position: #32 / 119
  • Number of attempts: 2
Copy punctuation - 760 entries

I want to copy the last line’s brackets, quotes, and commas to each line. How?

  • Best score: 19
  • Best player score: 41
  • Position: #114 / 188
  • Number of attempts: 1
Sorting paragraphs - 570 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 36
  • Position: #118 / 171
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 7737 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 7
  • Best player score: 40
  • Position: #919 / 1901
  • Number of attempts: 4
DeltaJay
Github:

entered into 21 challenges

contributed 0 challenges