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

Convert list of enums to list of localization terms - 20 entries

While making my game Piloteer, I had a large list of TaskTypes and needed to convert them to an equivalent list of localization terms, to be used when translating the game's text into different languages.

  • Best score: 86
  • Best player score: 123
  • Position: #7 / 9
  • Number of attempts: 1
From brakets to parens - 698 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: 56
  • Position: #139 / 160
  • Number of attempts: 1
Create json from a .env file - 1368 entries

A simple everyday task.

  • Best score: 39
  • Best player score: 110
  • Position: #289 / 323
  • Number of attempts: 1
Sort and Tag - 639 entries

The goal is to sort these lines alphabetically, assign a unique identifier to each line in the format "[01]", "[02]", etc., and then restore the original order of the lines while preserving the assigned identifiers.

  • Best score: 36
  • Best player score: 100
  • Position: #79 / 131
  • Number of attempts: 2
YAML to dotenv - 1292 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 48
  • Position: #237 / 271
  • Number of attempts: 1
Fix the git merge conflicts - 290 entries

Solve the merge conflicts in the Python file

  • Best score: 36
  • Best player score: 127
  • Position: #78 / 80
  • Number of attempts: 1
Replace markdown sections with numbering - 291 entries

Replace each section and subsection with their respective numbers

  • Best score: 29
  • Best player score: 92
  • Position: #55 / 76
  • Number of attempts: 1
Fix the Scala Method - 290 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: 32
  • Position: #85 / 92
  • Number of attempts: 1
Replace csv column if it's not empty - 249 entries

Replace the credit_score_percentile column with the value 0.0 but leave the empty ones untouched

  • Best score: 15
  • Best player score: 21
  • Position: #76 / 84
  • Number of attempts: 1
extract struct tag in go - 144 entries

Can you extract all struct tags in the fewest keystrokes possible?

  • Best score: 29
  • Best player score: 64
  • Position: #33 / 38
  • Number of attempts: 1
Copy punctuation - 673 entries

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

  • Best score: 19
  • Best player score: 49
  • Position: #123 / 160
  • Number of attempts: 2
Find anomalies - 161 entries

There is one special character per line

  • Best score: 30
  • Best player score: 59
  • Position: #32 / 43
  • Number of attempts: 2
Coordinate extraction - 66 entries

Get the coordinates of all "M"s from the Vim logo

  • Best score: 43
  • Best player score: 106
  • Position: #17 / 17
  • Number of attempts: 1
New teacher - 1440 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 34
  • Position: #266 / 302
  • Number of attempts: 1
Truth Table to ModelSim - 65 entries

Convert this truth table to simulator instructions!

  • Best score: 64
  • Best player score: 222
  • Position: #18 / 18
  • Number of attempts: 1
Quicksort - 2073 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 33
  • Position: #381 / 460
  • Number of attempts: 1
Populate 3D bone names list - 650 entries

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

  • Best score: 21
  • Best player score: 50
  • Position: #161 / 167
  • Number of attempts: 1
Find fix point of cos - 1444 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: 48
  • Position: #391 / 427
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 572 entries

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

  • Best score: 17
  • Best player score: 22
  • Position: #316 / 321
  • Number of attempts: 1
Substraction (bis) - 621 entries

Solve the equations (adapted from the original @Caek_'s challenge).

  • Best score: 21
  • Best player score: 41
  • Position: #91 / 115
  • Number of attempts: 1
Many duplicates - 1465 entries

Quick and easy

  • Best score: 7
  • Best player score: 12
  • Position: #430 / 478
  • Number of attempts: 1
delete swap - 1818 entries

delete all swap

  • Best score: 5
  • Best player score: 14
  • Position: #519 / 567
  • Number of attempts: 1
Generate a very basic Python constructor (fixed) - 1281 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 64
  • Position: #241 / 275
  • Number of attempts: 1
Visual block training - 1096 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 166
  • Position: #203 / 207
  • Number of attempts: 1
Put a newline after every 10 lines in vim - 1668 entries

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

  • Best score: 10
  • Best player score: 24
  • Position: #529 / 561
  • Number of attempts: 1
Simple, Practical, and Common - 33879 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 30
  • Position: #5394 / 7477
  • Number of attempts: 1
Extract argument from function - 2377 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 19
  • Position: #694 / 759
  • Number of attempts: 3
Replace and keep the case - 438 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 48
  • Position: #114 / 119
  • Number of attempts: 1
Two become one - 720 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 40
  • Position: #187 / 210
  • Number of attempts: 2
Mess in revision history - 1210 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 65
  • Position: #251 / 254
  • Number of attempts: 1
Dehamlizing - 185 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 56
  • Position: #65 / 72
  • Number of attempts: 3
Reformat long lines - 368 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

  • Best score: 15
  • Best player score: 23
  • Position: #121 / 137
  • Number of attempts: 1
Generate English Alphabets - 508 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 61
  • Position: #207 / 211
  • Number of attempts: 1
The Universal Declaration of Human Rights, Article 1 - 164 entries

Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)

  • Best score: 24
  • Best player score: 115
  • Position: #71 / 72
  • Number of attempts: 1
Change the content of a string - 1711 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 29
  • Position: #556 / 629
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3879 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 43
  • Position: #781 / 830
  • Number of attempts: 1
Simple text editing with Vim - 13274 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 29
  • Position: #3469 / 3811
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 7415 entries

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

  • Best score: 7
  • Best player score: 66
  • Position: #1700 / 1825
  • Number of attempts: 1
dennis
Github:

entered into 38 challenges

contributed 0 challenges