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

Parsing with CSV: Unify lines and result. - 179 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

  • Best score: 21
  • Best player score: 26
  • Position: #70 / 77
  • Number of attempts: 1
Exchanging Quotes - 858 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 40
  • Position: #179 / 230
  • Number of attempts: 2
replacing each line of a block selection - 2999 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 28
  • Position: #593 / 777
  • Number of attempts: 2
un-C-escape string - 58 entries

Convert escape sequences to characters

  • Best score: 12
  • Best player score: 12
  • Position: #14 / 52
  • Number of attempts: 1
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #705 / 1748
  • Number of attempts: 4
Ugly spreadsheet copy/paste to CSV - 1009 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 44
  • Position: #131 / 193
  • Number of attempts: 2
Replacing some words - 428 entries

How fast could it be?

  • Best score: 17
  • Best player score: 25
  • Position: #97 / 151
  • Number of attempts: 4
Multiplication table. - 232 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 74
  • Position: #34 / 68
  • Number of attempts: 2
formatted text to markdown - 184 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

  • Best score: 70
  • Best player score: 80
  • Position: #46 / 67
  • Number of attempts: 2
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #141 / 650
  • Number of attempts: 4
Line Zipper - 473 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 14
  • Position: #79 / 215
  • Number of attempts: 3
remove dupes from array - 1358 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 17
  • Position: #33 / 336
  • Number of attempts: 6
Alphabetize the directory - 298 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 32
  • Position: #37 / 101
  • Number of attempts: 3
PHP Array Syntax -> MailChimp Merge Syntax - 545 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 39
  • Position: #104 / 150
  • Number of attempts: 2
Sort entries based on date - 392 entries

Sort some entries in a Ledger-file based on date.

  • Best score: 11
  • Best player score: 11
  • Position: #27 / 117
  • Number of attempts: 3
Whitespace, empty lines and tabs - 3665 entries

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

  • Best score: 16
  • Best player score: 19
  • Position: #206 / 787
  • Number of attempts: 6
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: 14
  • Position: #958 / 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: 39
  • Position: #694 / 1706
  • Number of attempts: 1
learninghang
Twitter:

entered into 18 challenges

contributed 0 challenges