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 - 225 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: #37 / 72
  • Number of attempts: 5
Move list of uuids into a SQL query - 154 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: #42 / 52
  • Number of attempts: 3
Markdown Blog Editing - 364 entries

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

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

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 164
  • Position: #60 / 63
  • Number of attempts: 1
Fix timezone format - 294 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: #27 / 94
  • Number of attempts: 3
Remove adjacent duplicates - 560 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 38
  • Position: #108 / 147
  • Number of attempts: 3
Rearrange array to single level - 1501 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: #111 / 249
  • Number of attempts: 4
Rearrange array to one line - 707 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #43 / 170
  • Number of attempts: 4
Copy punctuation - 574 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: #110 / 145
  • Number of attempts: 3
Column wise pasting - 229 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 27
  • Position: #29 / 49
  • Number of attempts: 5
Deleting text - 278 entries

Delete everything except some specific numbers.

  • Best score: 26
  • Best player score: 45
  • Position: #45 / 92
  • Number of attempts: 2
New teacher - 1364 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 21
  • Position: #56 / 285
  • Number of attempts: 6
months to html list items - 1088 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #130 / 295
  • Number of attempts: 6
EDN reformat - 1175 entries

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

  • Best score: 17
  • Best player score: 22
  • Position: #98 / 167
  • Number of attempts: 14
Populate 3D bone names list - 636 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #97 / 164
  • Number of attempts: 3
Find fix point of cos - 1426 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: #418 / 422
  • Number of attempts: 1
Insert column data on Confluence-style table - 474 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: #99 / 110
  • Number of attempts: 1
Surround the 'z' character with brackets, quotes, and print as formatted string. - 567 entries

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

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

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

  • Best score: 14
  • Best player score: 19
  • Position: #297 / 565
  • Number of attempts: 3
Tabbed Table to Python Array - 743 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: #137 / 180
  • Number of attempts: 2
delete swap - 1801 entries

delete all swap

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

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

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

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #426 / 712
  • 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 - 4563 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #675 / 1113
  • Number of attempts: 1
Multiline to Single Line - 736 entries

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

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

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #403 / 533
  • Number of attempts: 2
Unsemantic linewrapping - 933 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 / 232
  • Number of attempts: 7
Applying same text modification in several lines - 2900 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #272 / 859
  • 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 - 920 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: #187 / 219
  • 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 - 2068 entries

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

  • Best score: 24
  • Best player score: 40
  • Position: #450 / 508
  • Number of attempts: 3
replacing each line of a block selection - 3005 entries

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

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

how fast can you switch two variable ?

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

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #88 / 655
  • 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