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

Swap function parameters and delete all comments in python. - 1083 entries

Swap function parameters and delete all comments in python.

  • Best score: 19
  • Best player score: 28
  • Position: #149 / 265
  • Number of attempts: 2
From brakets to parens - 1356 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: #231 / 309
  • Number of attempts: 2
Create json from a .env file - 1773 entries

A simple everyday task.

  • Best score: 38
  • Best player score: 64
  • Position: #240 / 431
  • Number of attempts: 1
YAML to dotenv - 1654 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 23
  • Position: #166 / 347
  • Number of attempts: 5
Fix timezone format - 385 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: 29
  • Position: #124 / 126
  • Number of attempts: 2
Remove adjacent duplicates - 732 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 32
  • Position: #113 / 187
  • Number of attempts: 5
Rearrange array to single level - 1832 entries

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

  • Best score: 14
  • Best player score: 33
  • Position: #221 / 308
  • Number of attempts: 1
Copy punctuation - 760 entries

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

  • Best score: 19
  • Best player score: 53
  • Position: #152 / 188
  • Number of attempts: 4
Swap assigned value - 696 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Position: #239 / 264
  • Number of attempts: 4
Switch function arguments - 2235 entries

How to switch two arguments of a function.

  • Best score: 7
  • Best player score: 17
  • Position: #649 / 687
  • Number of attempts: 4
Append semicolon after expressions - 1088 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 15
  • Position: #401 / 427
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 7737 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 7
  • Best player score: 46
  • Position: #1325 / 1901
  • Number of attempts: 3
Alex Clough
Github:

entered into 12 challenges

contributed 0 challenges