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

Replace markdown sections with numbering - 321 entries

Replace each section and subsection with their respective numbers

  • Best score: 29
  • Best player score: 91
  • Position: #64 / 89
  • Number of attempts: 1
Change class fields from snake case to camel case - 318 entries

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

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

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 23
  • Position: #153 / 239
  • Number of attempts: 3
Replace csv column if it's not empty - 294 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: #90 / 98
  • Number of attempts: 2
Move list of uuids into a SQL query - 245 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: #77 / 82
  • Number of attempts: 1
Fix timezone format - 351 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: #90 / 118
  • Number of attempts: 4
Rearrange array to single level - 1814 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: #196 / 306
  • Number of attempts: 6
Rearrange array to one line - 888 entries

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

  • Best score: 13
  • Best player score: 24
  • Position: #142 / 204
  • Number of attempts: 8
Copy punctuation - 734 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: #81 / 178
  • Number of attempts: 3
New teacher - 1513 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 31
  • Position: #256 / 318
  • Number of attempts: 2
months to html list items - 1146 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 27
  • Position: #183 / 310
  • Number of attempts: 3
Pick and sort servers from mirror list - 463 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: #75 / 92
  • Number of attempts: 10
Populate 3D bone names list - 656 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #102 / 169
  • Number of attempts: 3
Find fix point of cos - 1485 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: #257 / 434
  • Number of attempts: 1
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: 50
  • Position: #510 / 578
  • Number of attempts: 1
Reformat symbols in list - 1656 entries

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

  • Best score: 24
  • Best player score: 35
  • Position: #235 / 356
  • Number of attempts: 2
Poorly indented Python comments - 1350 entries

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

  • Best score: 15
  • Best player score: 79
  • Position: #200 / 225
  • Number of attempts: 2
delete swap - 1884 entries

delete all swap

  • Best score: 5
  • Best player score: 12
  • Position: #506 / 578
  • Number of attempts: 2
Rural Post - 4596 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #680 / 1122
  • Number of attempts: 7
One number per line - 18894 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 28
  • Position: #3616 / 3901
  • Number of attempts: 1
Swap values inside brackets - 2546 entries

Easy challenge.

  • Best score: 13
  • Best player score: 29
  • Position: #546 / 592
  • Number of attempts: 2
Unsemantic linewrapping - 947 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: #227 / 237
  • Number of attempts: 1
Applying same text modification in several lines - 2929 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #633 / 866
  • Number of attempts: 1
Extract wireshark capture filter - 235 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 34
  • Position: #65 / 77
  • Number of attempts: 2
From argument to object - 1552 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: #411 / 469
  • Number of attempts: 1
Team names - 1860 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 20
  • Position: #507 / 595
  • Number of attempts: 2
Array transposition - 2474 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 43
  • Position: #419 / 459
  • Number of attempts: 1
replacing each line of a block selection - 3050 entries

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

  • Best score: 18
  • Best player score: 37
  • Position: #763 / 787
  • Number of attempts: 2
switch variable - 5120 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Position: #1555 / 1761
  • Number of attempts: 1
Make it more readable - 2036 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 23
  • Position: #625 / 657
  • Number of attempts: 2
Sort and add attributes - 1576 entries

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

  • Best score: 33
  • Best player score: 36
  • Position: #469 / 611
  • Number of attempts: 2
Simple text editing with Vim - 13576 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #2058 / 3892
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 7649 entries

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

  • Best score: 7
  • Best player score: 73
  • Position: #1795 / 1882
  • Number of attempts: 2
Alex Elarbee
Github:

entered into 33 challenges

contributed 0 challenges