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

Remember FizzBuzz? - 513 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 67
  • Number of attempts: 2
Changing URL path in CSS - 111 entries

What's the quickest way to swap out all the URLs in a CSS file? Is it wasted keystrokes using look-behinds and look-aheads? (I'm sorry for the delete/report--I made a mistake with the last one requiring an ugly search for graphic to replace with images. I just intended this to be a simple search and replace that might possibly generate some macros or normals solutions that are quicker)

  • Best score: 40
  • Best player score: 43
  • Number of attempts: 2
Sort and add attributes - 1052 entries

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

  • Best score: 18
  • Best player score: 33
  • Number of attempts: 3
Assignment Alignment - 651 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 30
  • Number of attempts: 1
Saving the hashes(#) - 1686 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: 28
  • Number of attempts: 2
Enumerate words - 219 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 28
  • Number of attempts: 1
Inconsistent real estate paste - 140 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 28
  • Number of attempts: 3
Simple text editing with Vim - 9933 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
Reverse characters in a line - 554 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 2
Search and Replace 0 - 3841 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 3
switch variable - 4095 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 14
  • Number of attempts: 4
The name of the game - 574 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
fib.c cleanup - 54 entries

cleanup the file

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 1
Word frequency alignment - 195 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
replacing each line of a block selection - 2398 entries

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

  • Best score: 17
  • Best player score: 21
  • Number of attempts: 2
Append semicolon after expressions - 826 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
Ruby 1.9 hashes - 1030 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 1
Let's play some Ivmgolf - 864 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 1
A Simple One - 820 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
Cleanining up 80 column concatenated text - 183 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 54
  • Number of attempts: 1
Make it more readable - 1718 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 5358 entries

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

  • Best score: 32
  • Best player score: 37
  • Number of attempts: 3
abcd > a b c d - 237 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 1
remove dupes from array - 1164 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: 28
  • Number of attempts: 1
Shebangs for all - 1552 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 2
Remove semicolons after expressions - 429 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 2
Aligning function arguments to match a specific coding style - 151 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

  • Best score: 16
  • Best player score: 24
  • Number of attempts: 3
Numbering a List - 1698 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 26
  • Number of attempts: 1
Vertical Limit - 2032 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 26
  • Number of attempts: 3
Sort entries based on date - 292 entries

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

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 2
Whitespace, empty lines and tabs - 2508 entries

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

  • Best score: 16
  • Best player score: 27
  • Number of attempts: 2
Reed Riley
Twitter:

entered into 31 challenges

contributed 0 challenges