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

Switch function arguments - 1893 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
switch variable - 4778 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 1
Words in parens - 12379 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 1
The name of the game - 597 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Pairs of numbers - 340 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 30
  • Number of attempts: 1
Exchanging Quotes - 779 entries

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

  • Best score: 30
  • Best player score: 32
  • Number of attempts: 4
Calculate the table totals - 107 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

  • Best score: 33
  • Best player score: 71
  • Number of attempts: 1
Remove semicolons after expressions - 499 entries

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

  • Best score: 6
  • Best player score: 8
  • Number of attempts: 1
quotes inside quotes - 2973 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 1
Saving the hashes(#) - 1876 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: 25
  • Number of attempts: 5
Cleanining up 80 column concatenated text - 185 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: 41
  • Number of attempts: 1
Vertical Limit - 2264 entries

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

  • Best score: 21
  • Best player score: 25
  • Number of attempts: 1
Delete unwanted lines - 350 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
The meaning - 515 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Append semicolon after expressions - 898 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 4
Remove noise from HTTP log - 631 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 5734 entries

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

  • Best score: 32
  • Best player score: 43
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1412 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Number of attempts: 3
Maksim S.
Twitter:

Full-time movie buff with a part-time life

entered into 18 challenges

contributed 0 challenges