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

Convert list of enums to list of localization terms - 151 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: 274
  • Position: #46 / 46
  • Number of attempts: 1
From brakets to parens - 1134 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: 43
  • Position: #186 / 249
  • Number of attempts: 11
Create json from a .env file - 1585 entries

A simple everyday task.

  • Best score: 39
  • Best player score: 81
  • Position: #290 / 376
  • Number of attempts: 14
YAML to dotenv - 1542 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 34
  • Position: #243 / 316
  • Number of attempts: 19
CaN yOuR ViM dO ThAt? #1 - 270 entries

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

  • Best score: 41
  • Best player score: 57
  • Position: #101 / 107
  • Number of attempts: 1
Move list of uuids into a SQL query - 228 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: 76
  • Position: #66 / 74
  • Number of attempts: 5
Markdown Blog Editing - 467 entries

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

  • Best score: 30
  • Best player score: 99
  • Position: #97 / 108
  • Number of attempts: 3
Rearrange array to single level - 1791 entries

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

  • Best score: 14
  • Best player score: 34
  • Position: #221 / 299
  • Number of attempts: 11
New teacher - 1480 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 28
  • Position: #206 / 310
  • Number of attempts: 5
months to html list items - 1135 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 36
  • Position: #267 / 307
  • Number of attempts: 7
Quicksort - 2096 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 26
  • Position: #319 / 466
  • Number of attempts: 6
Remove line numbers - 779 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

  • Best score: 8
  • Best player score: 109
  • Position: #203 / 206
  • Number of attempts: 1
Find fix point of cos - 1480 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: 23
  • Position: #349 / 432
  • Number of attempts: 10
simple replacements - 1873 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 24
  • Position: #235 / 401
  • Number of attempts: 4
Inverting Lines - 1954 entries

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

  • Best score: 10
  • Best player score: 14
  • Position: #382 / 523
  • Number of attempts: 5
CSV to MD format - 448 entries

To convert a CSV list to Markdown list

  • Best score: 36
  • Best player score: 117
  • Position: #87 / 98
  • Number of attempts: 7
Python dataclasses - 1248 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 32
  • Position: #250 / 311
  • Number of attempts: 10
Modernise code - 1434 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 98
  • Position: #319 / 331
  • Number of attempts: 3
swap number pairs - 2169 entries

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

  • Best score: 16
  • Best player score: 49
  • Position: #356 / 393
  • Number of attempts: 6
HS Final exam vimgolf - 933 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 35
  • Position: #183 / 244
  • Number of attempts: 10
Aliases for cd - 908 entries

Create these beautiful aliases with as few strokes as possible. Are you up for the challenge?

  • Best score: 30
  • Best player score: 88
  • Position: #147 / 158
  • Number of attempts: 4
Unsemantic linewrapping - 943 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: 39
  • Position: #234 / 235
  • Number of attempts: 1
SCREAMING_SNAKE_CASE to Title Case - 1269 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

  • Best score: 19
  • Best player score: 31
  • Position: #204 / 264
  • Number of attempts: 7
Bad Copy Syntax - 2078 entries

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

  • Best score: 18
  • Best player score: 51
  • Position: #522 / 540
  • Number of attempts: 4
Box it - 7997 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 28
  • Position: #1297 / 1897
  • Number of attempts: 8
html paragraph to table - 634 entries

reformat html paragraph to table

  • Best score: 48
  • Best player score: 120
  • Position: #126 / 130
  • Number of attempts: 3
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: 34
  • Position: #462 / 469
  • Number of attempts: 3
Line under headers - 2093 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 36
  • Position: #407 / 514
  • Number of attempts: 4
Increment each number - 1062 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 43
  • Position: #247 / 257
  • Number of attempts: 3
Around the clock - 212 entries

You'll want to use 2 special commands to complete this. If you haven't yet, read through 'input.txt', especially :help simple-changes

  • Best score: 13
  • Best player score: 16
  • Position: #71 / 79
  • Number of attempts: 6
Delete to the end of the current line - 865 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 5
  • Position: #287 / 415
  • Number of attempts: 6
Remove quotes after first field - 408 entries

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

  • Best score: 16
  • Best player score: 28
  • Position: #92 / 95
  • Number of attempts: 7
Array transposition - 2472 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 73
  • Position: #448 / 458
  • Number of attempts: 3
Sean Morris
Github:

entered into 33 challenges

contributed 0 challenges