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

Filename Flip - 196 entries

Rearrange the MP3 filenames so that the identifier comes before the name.

  • Best score: 15
  • Best player score: 15
  • Position: #6 / 70
  • Number of attempts: 1
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: #25 / 157
  • Number of attempts: 1
Even and Odd - 393 entries

separate the even numbers from the odd numbers

  • Best score: 13
  • Best player score: 14
  • Position: #31 / 101
  • Number of attempts: 1
Swap function parameters and delete all comments in python. - 1073 entries

Swap function parameters and delete all comments in python.

  • Best score: 19
  • Best player score: 20
  • Position: #79 / 262
  • Number of attempts: 2
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: 50
  • Position: #5 / 60
  • Number of attempts: 5
From brakets to parens - 1350 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: 25
  • Position: #69 / 308
  • Number of attempts: 2
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: 25
  • Position: #19 / 302
  • Number of attempts: 1
YAML to dotenv - 1654 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 16
  • Position: #73 / 347
  • Number of attempts: 1
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: 17
  • Position: #86 / 184
  • Number of attempts: 2
Generate an entry for each month - 398 entries

The input file contains a URI with a month in it. Generate the URIs for all the other months up to a couple of years

  • Best score: 27
  • Best player score: 31
  • Position: #7 / 102
  • Number of attempts: 1
Fix the git merge conflicts - 394 entries

Solve the merge conflicts in the Python file

  • Best score: 36
  • Best player score: 38
  • Position: #13 / 111
  • Number of attempts: 1
Change class fields from camel case to snake case - 678 entries

This is the reverse of the previous challenge: https://www.vimgolf.com/challenges/9v006705493c000000000513

  • Best score: 18
  • Best player score: 18
  • Position: #52 / 160
  • Number of attempts: 1
Change class fields from snake case to camel case - 336 entries

Change the class fields in this Scala class from snake case to camel case

  • Best score: 13
  • Best player score: 13
  • Position: #78 / 127
  • Number of attempts: 1
Reorganize Pokémon - 902 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 18
  • Position: #46 / 251
  • Number of attempts: 1
CaN yOuR ViM dO ThAt? #2 - 117 entries

Tsoding's famous "Can your Vim do that?" https://www.youtube.com/watch?v=F4xc4jQO7ck&t=1429s

  • Best score: 49
  • Best player score: 49
  • Position: #9 / 31
  • Number of attempts: 1
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: 41
  • Position: #26 / 123
  • Number of attempts: 1
Append leading hyphen count to each line - 157 entries

Append the number of leading hyphens to the end of each line.

  • Best score: 23
  • Best player score: 27
  • Position: #29 / 43
  • 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: 30
  • Position: #14 / 119
  • Number of attempts: 1
Word completion - 329 entries

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 21
  • Position: #18 / 87
  • Number of attempts: 1
Fix timezone format - 385 entries

Add the missing T and Z in the datetime field. There should be a T instead of the space, and a Z at the end of the datetime. `2024-08-31 18:32:00;` -> `2024-08-31T18:32:00Z;`

  • Best score: 15
  • Best player score: 16
  • Position: #41 / 126
  • Number of attempts: 1
Remove adjacent duplicates - 732 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 19
  • Position: #24 / 187
  • Number of attempts: 1
Move to corresponding lines - 335 entries

Move the values to the corresponding lines.

  • Best score: 16
  • Best player score: 18
  • Position: #22 / 77
  • Number of attempts: 1
Rearrange array to single level - 1832 entries

The goal is to flatten the array into a single list and remove any empty elements.

  • Best score: 14
  • Best player score: 16
  • Position: #46 / 308
  • Number of attempts: 1
Rearrange array to one line - 907 entries

Rearrange the array content on only one line, and remove trailing commas

  • Best score: 13
  • Best player score: 13
  • Position: #38 / 209
  • Number of attempts: 1
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: 21
  • Position: #28 / 188
  • Number of attempts: 1
Column wise pasting - 282 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 25
  • Position: #27 / 63
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 885 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #358 / 458
  • Number of attempts: 1
Search and Replace 0 - 5170 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 7
  • Best player score: 12
  • Position: #775 / 1680
  • Number of attempts: 1
imports alignment (python) - 729 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #52 / 205
  • Number of attempts: 1
Ruby 1.9 compat - 670 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 14
  • Position: #78 / 245
  • Number of attempts: 1
Sorting paragraphs - 570 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 18
  • Position: #15 / 171
  • Number of attempts: 1
Reformat some Python - 660 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 34
  • Position: #49 / 249
  • Number of attempts: 1
Reformat a C golf submission - 682 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 22
  • Position: #9 / 223
  • Number of attempts: 1
Reverse characters in a line - 848 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 8
  • Best player score: 13
  • Position: #105 / 285
  • Number of attempts: 1
Reformat most common surnames - 848 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 24
  • Position: #46 / 242
  • Number of attempts: 1
Remember FizzBuzz? - 837 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 41
  • Position: #24 / 214
  • Number of attempts: 1
Sort and add attributes - 1605 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 33
  • Position: #326 / 622
  • Number of attempts: 1
Reconstruct the Sentence - 1763 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 19
  • Position: #19 / 461
  • Number of attempts: 2
Flodder-challenge - 1527 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 28
  • Position: #90 / 384
  • Number of attempts: 2
Simple text editing with Vim - 13682 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 13
  • Position: #785 / 3920
  • Number of attempts: 1
Hawsqazrit
Github:

entered into 40 challenges

contributed 0 challenges