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

Rearrange array to single level - 1092 entries

The goal is to flatten the array into a single list and remove any empty elements.

  • Best score: 14
  • Best player score: 16
  • Position: #19 / 184
  • Number of attempts: 4
Rearrange array to one line - 521 entries

Rearrange the array content on only one line, and remove trailing commas

  • Best score: 13
  • Best player score: 13
  • Position: #14 / 129
  • Number of attempts: 7
Copy punctuation - 419 entries

I want to copy the last line’s brackets, quotes, and commas to each line. How?

  • Best score: 19
  • Best player score: 19
  • Position: #11 / 106
  • Number of attempts: 12
Column wise pasting - 133 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 17
  • Position: #4 / 32
  • Number of attempts: 7
Paste a column after a column - 2504 entries

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

  • Best score: 14
  • Best player score: 14
  • Position: #105 / 547
  • Number of attempts: 9
Put a newline after every 10 lines in vim - 1656 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 11
  • Position: #207 / 555
  • Number of attempts: 3
Search and Replace 0 - 4964 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #734 / 1617
  • Number of attempts: 4
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 13
  • Position: #21 / 3960
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1606 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #133 / 446
  • Number of attempts: 5
Saving the hashes(#) - 2053 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
  • Position: #191 / 479
  • Number of attempts: 5
Vertical Limit - 2522 entries

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

  • Best score: 21
  • Best player score: 21
  • Position: #105 / 751
  • Number of attempts: 2
replacing each line of a block selection - 2996 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #134 / 775
  • Number of attempts: 8
Switch function arguments - 2117 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #195 / 657
  • Number of attempts: 5
Append semicolon after expressions - 1046 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #146 / 413
  • Number of attempts: 5
switch variable - 5065 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #670 / 1745
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 1007 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #15 / 192
  • Number of attempts: 4
Make it more readable - 1986 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #114 / 646
  • Number of attempts: 4
remove dupes from array - 1354 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: #89 / 335
  • Number of attempts: 7
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #87 / 652
  • Number of attempts: 7
Ruby 1.9 hashes - 1236 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: 12
  • Position: #113 / 404
  • Number of attempts: 2
Shebangs for all - 1975 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: 11
  • Position: #75 / 508
  • Number of attempts: 5
A Simple One - 1043 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
  • Position: #582 / 659
  • Number of attempts: 1
The Cake is a Lie - 1330 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #284 / 523
  • Number of attempts: 2
Make Fancy Header - 1045 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #128 / 342
  • Number of attempts: 5
Change the content of a string - 1552 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #231 / 580
  • Number of attempts: 2
Sort and add attributes - 1421 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #287 / 552
  • Number of attempts: 1
Reconstruct the Sentence - 1477 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: 20
  • Position: #146 / 405
  • Number of attempts: 9
Whitespace, empty lines and tabs - 3589 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #170 / 775
  • Number of attempts: 12
Flodder-challenge - 1224 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 28
  • Position: #73 / 328
  • Number of attempts: 7
Simple text editing with Vim - 12680 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1994 / 3665
  • Number of attempts: 7
Reformat/Refactor a Golfer Class - 6866 entries

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

  • Best score: 28
  • Best player score: 34
  • Position: #322 / 1681
  • Number of attempts: 10
Suhaib Murshid
Github:

entered into 31 challenges

contributed 0 challenges