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

Changing URL path in CSS - 124 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: 40
  • Position: #15 / 58
  • Number of attempts: 6
Create a pandoc compatible table - 181 entries

In [this vimcast][1], a featured gist from Tim Pope shows how to quickly make a simple table structure. How fast can you convert it to pandoc's markdown style? [1]: http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

  • Best score: 32
  • Best player score: 37
  • Position: #22 / 53
  • Number of attempts: 3
Shuffle and Sort - 208 entries

The values where sorted incorrectly. Get them back to how they are supposed to be

  • Best score: 17
  • Best player score: 28
  • Position: #50 / 65
  • Number of attempts: 2
Convert regular pandoc footnotes to in-line notes - 61 entries

Pandoc extends markdown by allowing footnotes, which are usually represented with a footnote identifier followed later in the document by the footnote itself. But Pandoc also allows inline footnotes without identifiers. How many strokes does it take to convert regular footnotes to inline notes? (NB: I've had trouble figuring out whether text-width makes a difference to Vimgolf in comparing the input and output file. I finally tested this locally using the Vimgolf vimrc and did a "gq" on the entire buffer as the last step. Apologies if I'm making a newbie mistake. First time submitter.)

  • Best score: 26
  • Best player score: 62
  • Position: #15 / 17
  • Number of attempts: 1
Complete the circuit grid! - 81 entries

Continuing from the last challenge, add additional rows to the grid. Change each of the names from 'A1'...'A10' to 'B1'...'B10', 'C1'...'C10', etc, and for each new row add 0.7 to the X values in the (X Y) at the end of each line.

  • Best score: 49
  • Best player score: 56
  • Position: #8 / 28
  • Number of attempts: 2
Cleanining up 80 column concatenated text - 188 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: 33
  • Position: #23 / 76
  • Number of attempts: 3
Convert pandoc unordered list to a numbered list - 163 entries

I know it's possible to use #. in pandoc to auto-generate numbered lists, but then it's not easy to tell how many items there are when reading it in Markdown. How fast can you make the switch?

  • Best score: 20
  • Best player score: 24
  • Position: #18 / 56
  • Number of attempts: 2
Inconsistent real estate paste - 184 entries

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

  • Best score: 24
  • Best player score: 40
  • Position: #35 / 55
  • Number of attempts: 2
Vertical Limit - 2436 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #118 / 735
  • Number of attempts: 6
Make the circuit grid! - 85 entries

Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.

  • Best score: 26
  • Best player score: 26
  • Position: #10 / 48
  • Number of attempts: 4
Aligning function arguments to match a specific coding style - 220 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
  • Position: #55 / 67
  • Number of attempts: 1
replacing each line of a block selection - 2925 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #343 / 764
  • Number of attempts: 3
Switch function arguments - 2064 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #33 / 647
  • Number of attempts: 6
Append semicolon after expressions - 1002 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #22 / 401
  • Number of attempts: 5
Reverse and double space - 489 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 15
  • Position: #75 / 194
  • Number of attempts: 3
Remove noise from HTTP log - 693 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: 15
  • Position: #44 / 270
  • Number of attempts: 3
Remove semicolons after expressions - 628 entries

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

  • Best score: 6
  • Best player score: 6
  • Position: #36 / 258
  • Number of attempts: 2
The meaning - 554 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #128 / 355
  • Number of attempts: 1
Calculate the table totals - 130 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #4 / 43
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6511 entries

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

  • Best score: 32
  • Best player score: 32
  • Position: #21 / 1602
  • Number of attempts: 11
Sean Griffin
Twitter:

New Media Manager for Griffin & Associates. I program and strategize things.

entered into 20 challenges

contributed 0 challenges