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 columns and transform to CSV format - 310 entries

Turn this spreadsheet output into a CSV file but first swap the columns

  • Best score: 16
  • Best player score: 28
  • Position: #106 / 114
  • Number of attempts: 1
Reorganize Pokémon - 602 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 21
  • Position: #66 / 164
  • Number of attempts: 3
CaN yOuR ViM dO ThAt? #1 - 180 entries

Tsoding's famous "Can your Vim do that?" https://youtu.be/Bafo3hhheHU?si=DfcT4sUEMTSAevnx&t=1091

  • Best score: 41
  • Best player score: 45
  • Position: #24 / 72
  • Number of attempts: 2
Remove adjacent duplicates - 571 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 22
  • Position: #60 / 149
  • Number of attempts: 1
months to html list items - 1088 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #131 / 295
  • Number of attempts: 1
Quicksort - 2036 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: 27
  • Position: #321 / 451
  • Number of attempts: 6
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: 15
  • Position: #259 / 422
  • Number of attempts: 3
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: 18
  • Position: #274 / 318
  • 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: 22
  • Position: #357 / 565
  • Number of attempts: 2
swap number pairs - 2126 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 17
  • Position: #116 / 387
  • Number of attempts: 14
Python: Def to Lambda - 460 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 24
  • Position: #142 / 157
  • Number of attempts: 2
Rural Post - 4567 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #209 / 1114
  • Number of attempts: 5
prepend * to every non-blank line - 6358 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 11
  • Position: #763 / 1551
  • Number of attempts: 6
Add semicolons - 10899 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1785 / 3078
  • Number of attempts: 2
Just the middle - 11500 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3214 / 4216
  • Number of attempts: 4
Adam's challenge - 1008 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 26
  • Position: #252 / 275
  • Number of attempts: 1
I forgot quotes - 16051 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2050 / 4194
  • Number of attempts: 2
abcd > a b c d - 298 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #205 / 227
  • Number of attempts: 1
Saving the hashes(#) - 2063 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 21
  • Position: #128 / 480
  • Number of attempts: 10
Append semicolon after expressions - 1057 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #361 / 420
  • Number of attempts: 1
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 18
  • Position: #168 / 199
  • Number of attempts: 1
Increment, increment, increment.... - 701 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #71 / 413
  • Number of attempts: 3
Remember FizzBuzz? - 742 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 97
  • Position: #180 / 194
  • Number of attempts: 1
Change the content of a string - 1649 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #397 / 609
  • Number of attempts: 1
Sort and add attributes - 1501 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 34
  • Position: #398 / 582
  • Number of attempts: 1
Reconstruct the Sentence - 1649 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 22
  • Position: #283 / 434
  • Number of attempts: 4
Braces or Brackets? - 1073 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 51
  • Position: #256 / 331
  • Number of attempts: 1
Simple text editing with Vim - 13101 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #2166 / 3768
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 7230 entries

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

  • Best score: 10
  • Best player score: 70
  • Position: #1691 / 1779
  • Number of attempts: 1
🥚
Twitter2:

entered into 29 challenges

contributed 0 challenges