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

Change class fields from snake case to camel case - 230 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #17 / 88
  • Number of attempts: 2
Reorganize Pokémon - 577 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 23
  • Position: #112 / 156
  • Number of attempts: 3
Replace csv column if it's not empty - 185 entries

Replace the credit_score_percentile column with the value 0.0 but leave the empty ones untouched

  • Best score: 15
  • Best player score: 30
  • Position: #58 / 64
  • Number of attempts: 2
Move list of uuids into a SQL query - 154 entries

Take the list of UUIDs and use them as a filter in the where statement of a SQL query

  • Best score: 57
  • Best player score: 83
  • Position: #51 / 52
  • Number of attempts: 1
Fix timezone format - 282 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: 20
  • Position: #73 / 92
  • Number of attempts: 4
Rearrange array to single level - 1493 entries

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

  • Best score: 14
  • Best player score: 31
  • Position: #159 / 246
  • Number of attempts: 6
Rearrange array to one line - 707 entries

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

  • Best score: 13
  • Best player score: 24
  • Position: #116 / 170
  • Number of attempts: 8
Copy punctuation - 570 entries

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

  • Best score: 19
  • Best player score: 34
  • Position: #67 / 144
  • Number of attempts: 3
New teacher - 1357 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 31
  • Position: #228 / 282
  • Number of attempts: 2
months to html list items - 1088 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 27
  • Position: #174 / 295
  • Number of attempts: 3
Pick and sort servers from mirror list - 441 entries

Retrieve the primary server for each country from a mirror list file and organize them alphabetically by country name. Given a mirror list file containing server information for various countries, the objective is to extract the primary server from each country and then arrange these servers in alphabetical order based on the respective country names.

  • Best score: 28
  • Best player score: 50
  • Position: #72 / 88
  • Number of attempts: 10
Populate 3D bone names list - 636 entries

Ran into this at work, excited to see how this gets optimized

  • Best score: 21
  • Best player score: 30
  • Position: #98 / 164
  • Number of attempts: 3
Find fix point of cos - 1426 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 15
  • Position: #255 / 422
  • Number of attempts: 1
Paste a column after a column - 2604 entries

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

  • Best score: 14
  • Best player score: 50
  • Position: #498 / 565
  • Number of attempts: 1
Reformat symbols in list - 1633 entries

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

  • Best score: 24
  • Best player score: 35
  • Position: #232 / 351
  • Number of attempts: 2
Poorly indented Python comments - 1328 entries

Fix the alignment of some Python comments as quickly as possible.

  • Best score: 15
  • Best player score: 79
  • Position: #198 / 223
  • Number of attempts: 2
delete swap - 1801 entries

delete all swap

  • Best score: 5
  • Best player score: 12
  • Position: #491 / 561
  • Number of attempts: 2
Rural Post - 4563 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #674 / 1113
  • Number of attempts: 7
One number per line - 18780 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 28
  • Position: #3598 / 3877
  • Number of attempts: 1
Swap values inside brackets - 2515 entries

Easy challenge.

  • Best score: 13
  • Best player score: 29
  • Position: #538 / 584
  • Number of attempts: 2
Unsemantic linewrapping - 933 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: 19
  • Position: #224 / 232
  • Number of attempts: 1
Applying same text modification in several lines - 2900 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 16
  • Position: #627 / 859
  • Number of attempts: 1
Extract wireshark capture filter - 218 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 34
  • Position: #62 / 73
  • Number of attempts: 2
From argument to object - 1524 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 22
  • Position: #406 / 463
  • Number of attempts: 1
Team names - 1846 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 20
  • Position: #503 / 591
  • Number of attempts: 2
Array transposition - 2427 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 43
  • Position: #412 / 450
  • Number of attempts: 1
replacing each line of a block selection - 3005 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 37
  • Position: #755 / 779
  • Number of attempts: 2
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Position: #1545 / 1750
  • Number of attempts: 1
Make it more readable - 2009 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 23
  • Position: #620 / 652
  • Number of attempts: 2
Sort and add attributes - 1499 entries

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

  • Best score: 33
  • Best player score: 36
  • Position: #448 / 581
  • Number of attempts: 2
Simple text editing with Vim - 13092 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #2029 / 3765
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 7228 entries

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

  • Best score: 10
  • Best player score: 73
  • Position: #1702 / 1777
  • Number of attempts: 2
Alex Elarbee
Github:

entered into 32 challenges

contributed 0 challenges