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

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

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

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 21
  • Position: #41 / 80
  • Number of attempts: 3
CaN yOuR ViM dO ThAt? #1 - 77 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: #15 / 32
  • Number of attempts: 2
Remove adjacent duplicates - 445 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 22
  • Position: #48 / 117
  • Number of attempts: 1
months to html list items - 1010 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #126 / 274
  • Number of attempts: 1
Quicksort - 1962 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: #305 / 431
  • Number of attempts: 6
Find fix point of cos - 1402 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: #257 / 415
  • Number of attempts: 3
Surround the 'z' character with brackets, quotes, and print as formatted string. - 554 entries

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

  • Best score: 17
  • Best player score: 18
  • Position: #266 / 309
  • Number of attempts: 1
Paste a column after a column - 2537 entries

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

  • Best score: 14
  • Best player score: 22
  • Position: #347 / 553
  • Number of attempts: 2
swap number pairs - 2103 entries

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

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

LAMBDA!!!

  • Best score: 19
  • Best player score: 24
  • Position: #141 / 156
  • Number of attempts: 2
Rural Post - 4479 entries

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

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #760 / 1537
  • Number of attempts: 6
Add semicolons - 10852 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1780 / 3063
  • Number of attempts: 2
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3211 / 4197
  • Number of attempts: 4
Adam's challenge - 984 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: #247 / 270
  • Number of attempts: 1
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2044 / 4180
  • Number of attempts: 2
abcd > a b c d - 291 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #205 / 222
  • 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 - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #360 / 419
  • 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.... - 688 entries

Vim likes macros

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

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 97
  • Position: #176 / 190
  • Number of attempts: 1
Change the content of a string - 1580 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #381 / 588
  • Number of attempts: 1
Sort and add attributes - 1451 entries

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

  • Best score: 33
  • Best player score: 34
  • Position: #386 / 563
  • Number of attempts: 1
Reconstruct the Sentence - 1507 entries

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

  • Best score: 20
  • Best player score: 22
  • Position: #271 / 412
  • Number of attempts: 4
Braces or Brackets? - 1015 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: #249 / 315
  • Number of attempts: 1
Simple text editing with Vim - 12811 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #2132 / 3694
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 6982 entries

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

  • Best score: 28
  • Best player score: 70
  • Position: #1628 / 1706
  • Number of attempts: 1
🥚
Twitter2:

entered into 29 challenges

contributed 0 challenges