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 - 306 entries

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

  • Best score: 2
  • Best player score: 23
  • Position: #48 / 98
  • Number of attempts: 5
Move list of uuids into a SQL query - 227 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: #57 / 73
  • Number of attempts: 3
Markdown Blog Editing - 456 entries

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

  • Best score: 30
  • Best player score: 61
  • Position: #81 / 107
  • Number of attempts: 1
Word completion - 284 entries

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 164
  • Position: #71 / 76
  • Number of attempts: 1
Fix timezone format - 326 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: #28 / 105
  • Number of attempts: 3
Remove adjacent duplicates - 666 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 38
  • Position: #123 / 167
  • Number of attempts: 3
Rearrange array to single level - 1720 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: #122 / 289
  • Number of attempts: 4
Rearrange array to one line - 807 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #52 / 190
  • Number of attempts: 4
Copy punctuation - 682 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: #123 / 166
  • Number of attempts: 3
Column wise pasting - 256 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 27
  • Position: #32 / 53
  • Number of attempts: 5
Deleting text - 329 entries

Delete everything except some specific numbers.

  • Best score: 26
  • Best player score: 45
  • Position: #49 / 103
  • Number of attempts: 2
New teacher - 1465 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 21
  • Position: #60 / 306
  • Number of attempts: 6
months to html list items - 1130 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #133 / 306
  • Number of attempts: 6
EDN reformat - 1209 entries

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

  • Best score: 17
  • Best player score: 22
  • Position: #101 / 170
  • Number of attempts: 14
Populate 3D bone names list - 652 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #100 / 168
  • Number of attempts: 3
Find fix point of cos - 1468 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: #427 / 431
  • Number of attempts: 1
Insert column data on Confluence-style table - 500 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: #101 / 112
  • Number of attempts: 1
Surround the 'z' character with brackets, quotes, and print as formatted string. - 576 entries

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

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

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 380
  • Position: #84 / 99
  • Number of attempts: 1
Paste a column after a column - 2662 entries

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

  • Best score: 14
  • Best player score: 19
  • Position: #306 / 576
  • Number of attempts: 3
Tabbed Table to Python Array - 769 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: #141 / 184
  • Number of attempts: 2
delete swap - 1834 entries

delete all swap

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #196 / 564
  • Number of attempts: 5
hello-world-vimgolf - 2523 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #432 / 722
  • Number of attempts: 2
Fill in the chess board - 979 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: #121 / 186
  • Number of attempts: 3
Easy modification of ssh config - 397 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 27
  • Position: #62 / 116
  • Number of attempts: 4
Rural Post - 4579 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #676 / 1117
  • Number of attempts: 1
Multiline to Single Line - 750 entries

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

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

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #403 / 535
  • Number of attempts: 2
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: 9
  • Position: #104 / 235
  • Number of attempts: 7
Applying same text modification in several lines - 2920 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #273 / 864
  • Number of attempts: 6
comment and uncomment code inline - 1151 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 / 328
  • Number of attempts: 4
Missing Library and a Typo - 943 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: #189 / 221
  • Number of attempts: 3
Simple addition - 332 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: #81 / 124
  • Number of attempts: 1
Line under headers - 2087 entries

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

  • Best score: 24
  • Best player score: 40
  • Position: #455 / 513
  • Number of attempts: 3
replacing each line of a block selection - 3026 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #234 / 783
  • Number of attempts: 9
switch variable - 5101 entries

how fast can you switch two variable ?

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

Pretty simple, number the list.

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

line up the operators. Use spaces, not tabs.

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

entered into 40 challenges

contributed 0 challenges