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

Fix the Scala Method - 105 entries

Fix the missing semicolons and the Int type, ensure the floating point division, and remove the unnecessary return.

  • Best score: 9
  • Best player score: 23
  • Position: #21 / 38
  • Number of attempts: 5
Move list of uuids into a SQL query - 68 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: 74
  • Position: #25 / 28
  • Number of attempts: 3
Markdown Blog Editing - 253 entries

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

  • Best score: 30
  • Best player score: 61
  • Position: #46 / 62
  • Number of attempts: 1
Word completion - 179 entries

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 164
  • Position: #48 / 50
  • Number of attempts: 1
Fix timezone format - 225 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: #23 / 75
  • Number of attempts: 3
Remove adjacent duplicates - 445 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 38
  • Position: #87 / 117
  • Number of attempts: 3
Rearrange array to single level - 1298 entries

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

  • Best score: 14
  • Best player score: 24
  • Position: #98 / 205
  • Number of attempts: 4
Rearrange array to one line - 602 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #38 / 144
  • Number of attempts: 4
Copy punctuation - 487 entries

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

  • Best score: 19
  • Best player score: 48
  • Position: #93 / 121
  • Number of attempts: 3
Column wise pasting - 172 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 27
  • Position: #24 / 37
  • Number of attempts: 5
Deleting text - 254 entries

Delete everything except some specific numbers.

  • Best score: 26
  • Best player score: 45
  • Position: #44 / 81
  • Number of attempts: 2
New teacher - 923 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 21
  • Position: #42 / 194
  • Number of attempts: 6
months to html list items - 1010 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #125 / 274
  • Number of attempts: 6
EDN reformat - 1158 entries

The goal is to make the code more readable and concise while maintaining its functionality.

  • Best score: 17
  • Best player score: 22
  • Position: #97 / 164
  • Number of attempts: 14
Populate 3D bone names list - 629 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #96 / 162
  • Number of attempts: 3
Find fix point of cos - 1402 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: 147
  • Position: #411 / 415
  • Number of attempts: 1
Insert column data on Confluence-style table - 458 entries

Add ip addresses into new "IP" column based on the last digits from the "Server" column

  • Best score: 33
  • Best player score: 100
  • Position: #98 / 109
  • Number of attempts: 1
Surround the 'z' character with brackets, quotes, and print as formatted string. - 554 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #226 / 309
  • Number of attempts: 1
Easier Align - 406 entries

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 380
  • Position: #81 / 96
  • Number of attempts: 1
Paste a column after a column - 2537 entries

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

  • Best score: 14
  • Best player score: 19
  • Position: #290 / 553
  • Number of attempts: 3
Tabbed Table to Python Array - 734 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 67
  • Position: #136 / 179
  • Number of attempts: 2
delete swap - 1786 entries

delete all swap

  • Best score: 5
  • Best player score: 6
  • Position: #417 / 555
  • Number of attempts: 4
Put a newline after every 10 lines in vim - 1657 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 11
  • Position: #195 / 556
  • Number of attempts: 5
hello-world-vimgolf - 2499 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #425 / 708
  • Number of attempts: 2
Fill in the chess board - 959 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 41
  • Position: #120 / 185
  • Number of attempts: 3
Easy modification of ssh config - 371 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 27
  • Position: #59 / 112
  • Number of attempts: 4
Rural Post - 4479 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #664 / 1097
  • Number of attempts: 1
Multiline to Single Line - 700 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #257 / 302
  • Number of attempts: 4
Yo To Hello - 1130 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #402 / 524
  • Number of attempts: 2
Unsemantic linewrapping - 928 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: 9
  • Position: #104 / 231
  • Number of attempts: 7
Applying same text modification in several lines - 2880 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #272 / 851
  • Number of attempts: 6
comment and uncomment code inline - 1122 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 9
  • Position: #163 / 322
  • Number of attempts: 4
Missing Library and a Typo - 887 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

  • Best score: 14
  • Best player score: 22
  • Position: #181 / 213
  • Number of attempts: 3
Simple addition - 326 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 13
  • Position: #79 / 122
  • Number of attempts: 1
Line under headers - 2044 entries

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

  • Best score: 24
  • Best player score: 40
  • Position: #446 / 503
  • Number of attempts: 3
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #233 / 777
  • Number of attempts: 9
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #671 / 1748
  • Number of attempts: 2
Multiplication table. - 232 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 404
  • Position: #68 / 68
  • Number of attempts: 1
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #88 / 652
  • Number of attempts: 2
Assignment Alignment - 883 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 31
  • Position: #189 / 220
  • Number of attempts: 4
DayuanX
Github:

entered into 40 challenges

contributed 0 challenges