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

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

  • Best score: 16
  • Best player score: 28
  • Position: #153 / 175
  • Number of attempts: 1
Reorganize Pokémon - 875 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 21
  • Position: #85 / 240
  • Number of attempts: 3
CaN yOuR ViM dO ThAt? #1 - 297 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: #39 / 118
  • Number of attempts: 2
Remove adjacent duplicates - 727 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 22
  • Position: #73 / 182
  • Number of attempts: 1
months to html list items - 1151 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #136 / 311
  • Number of attempts: 1
Quicksort - 2113 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: #333 / 472
  • Number of attempts: 6
Find fix point of cos - 1485 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: #261 / 434
  • Number of attempts: 3
Surround the 'z' character with brackets, quotes, and print as formatted string. - 582 entries

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

  • Best score: 17
  • Best player score: 18
  • Position: #280 / 328
  • Number of attempts: 1
Paste a column after a column - 2668 entries

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

  • Best score: 14
  • Best player score: 22
  • Position: #368 / 578
  • Number of attempts: 2
swap number pairs - 2173 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #118 / 394
  • Number of attempts: 14
Python: Def to Lambda - 492 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 24
  • Position: #147 / 162
  • Number of attempts: 2
Rural Post - 4602 entries

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

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #766 / 1562
  • Number of attempts: 6
Add semicolons - 10956 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1794 / 3098
  • Number of attempts: 2
Just the middle - 11616 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3224 / 4255
  • Number of attempts: 4
Adam's challenge - 1042 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: #258 / 281
  • Number of attempts: 1
I forgot quotes - 16237 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2065 / 4224
  • Number of attempts: 2
abcd > a b c d - 308 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #205 / 231
  • Number of attempts: 1
Saving the hashes(#) - 2116 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: #133 / 488
  • Number of attempts: 10
Append semicolon after expressions - 1086 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #366 / 426
  • Number of attempts: 1
Reverse and double space - 511 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 18
  • Position: #171 / 202
  • Number of attempts: 1
Increment, increment, increment.... - 706 entries

Vim likes macros

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

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 97
  • Position: #192 / 209
  • Number of attempts: 1
Change the content of a string - 1799 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #427 / 655
  • Number of attempts: 1
Sort and add attributes - 1591 entries

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

  • Best score: 33
  • Best player score: 34
  • Position: #413 / 615
  • Number of attempts: 1
Reconstruct the Sentence - 1745 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: #294 / 457
  • Number of attempts: 4
Braces or Brackets? - 1201 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: #277 / 362
  • Number of attempts: 1
Simple text editing with Vim - 13626 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #2238 / 3902
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 7681 entries

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

  • Best score: 7
  • Best player score: 70
  • Position: #1786 / 1889
  • Number of attempts: 1
🥚
Twitter2:

entered into 29 challenges

contributed 0 challenges