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 - 162 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: #27 / 54
  • Number of attempts: 5
Move list of uuids into a SQL query - 90 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: #31 / 39
  • Number of attempts: 3
Markdown Blog Editing - 298 entries

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

  • Best score: 30
  • Best player score: 61
  • Position: #51 / 70
  • Number of attempts: 1
Word completion - 198 entries

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 164
  • Position: #54 / 56
  • Number of attempts: 1
Fix timezone format - 253 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: #25 / 85
  • Number of attempts: 3
Remove adjacent duplicates - 531 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 38
  • Position: #101 / 137
  • Number of attempts: 3
Rearrange array to single level - 1396 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: #102 / 229
  • Number of attempts: 4
Rearrange array to one line - 667 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #40 / 161
  • Number of attempts: 4
Copy punctuation - 521 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: #100 / 133
  • Number of attempts: 3
Column wise pasting - 174 entries

Make a table from 3 columns

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

Delete everything except some specific numbers.

  • Best score: 26
  • Best player score: 45
  • Position: #43 / 84
  • Number of attempts: 2
New teacher - 1101 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 21
  • Position: #46 / 236
  • Number of attempts: 6
months to html list items - 1042 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #126 / 284
  • 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 - 633 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #96 / 163
  • Number of attempts: 3
Find fix point of cos - 1408 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: #414 / 418
  • 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. - 561 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #226 / 314
  • 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 - 2555 entries

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

  • Best score: 14
  • Best player score: 19
  • Position: #292 / 557
  • Number of attempts: 3
Tabbed Table to Python Array - 735 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 - 1788 entries

delete all swap

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

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

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

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #425 / 709
  • 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 - 382 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 27
  • Position: #61 / 115
  • Number of attempts: 4
Rural Post - 4526 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #671 / 1107
  • Number of attempts: 1
Multiline to Single Line - 731 entries

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

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

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #403 / 529
  • 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 - 2897 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #272 / 857
  • Number of attempts: 6
comment and uncomment code inline - 1124 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 / 323
  • Number of attempts: 4
Missing Library and a Typo - 893 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: #182 / 214
  • Number of attempts: 3
Simple addition - 331 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: #80 / 123
  • Number of attempts: 1
Line under headers - 2059 entries

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

  • Best score: 24
  • Best player score: 40
  • Position: #449 / 507
  • Number of attempts: 3
replacing each line of a block selection - 3001 entries

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

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

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #671 / 1749
  • 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 - 1935 entries

Pretty simple, number the list.

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

line up the operators. Use spaces, not tabs.

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

entered into 40 challenges

contributed 0 challenges