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 - 1832 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: #41 / 308
  • Number of attempts: 4
Rearrange array to one line - 907 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #14 / 209
  • Number of attempts: 7
Copy punctuation - 760 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 / 188
  • Number of attempts: 12
Column wise pasting - 282 entries

Make a table from 3 columns

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

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

  • Best score: 7
  • Best player score: 14
  • Position: #106 / 580
  • Number of attempts: 9
Put a newline after every 10 lines in vim - 1688 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #209 / 567
  • Number of attempts: 3
Search and Replace 0 - 5170 entries

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

  • Best score: 7
  • Best player score: 12
  • Position: #735 / 1680
  • Number of attempts: 4
Words in parens - 13063 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 13
  • Position: #21 / 3995
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1643 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 / 458
  • Number of attempts: 5
Saving the hashes(#) - 2118 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: 7
  • Best player score: 20
  • Position: #76 / 490
  • Number of attempts: 9
Let's play some Ivmgolf - 1167 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #148 / 462
  • Number of attempts: 2
Vertical Limit - 2642 entries

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

  • Best score: 10
  • Best player score: 21
  • Position: #106 / 781
  • Number of attempts: 2
replacing each line of a block selection - 3070 entries

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

  • Best score: 7
  • Best player score: 18
  • Position: #135 / 791
  • Number of attempts: 8
Switch function arguments - 2235 entries

How to switch two arguments of a function.

  • Best score: 7
  • Best player score: 11
  • Position: #196 / 687
  • Number of attempts: 5
Append semicolon after expressions - 1088 entries

Some lines need the semicolon, some don't.

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

how fast can you switch two variable ?

  • Best score: 9
  • Best player score: 11
  • Position: #671 / 1767
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 1046 entries

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

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

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #114 / 659
  • Number of attempts: 4
remove dupes from array - 1379 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 / 342
  • Number of attempts: 7
Numbering a List - 1970 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #87 / 662
  • Number of attempts: 7
Ruby 1.9 hashes - 1315 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 / 421
  • Number of attempts: 2
Shebangs for all - 2105 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 / 534
  • Number of attempts: 5
A Simple One - 1096 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 / 683
  • Number of attempts: 1
The Cake is a Lie - 1422 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 9
  • Position: #285 / 546
  • Number of attempts: 2
Make Fancy Header - 1111 entries

Make the header text stand out with surrounding asterisks

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

This docstring is a complete lie. Fix it.

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

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

  • Best score: 33
  • Best player score: 33
  • Position: #287 / 622
  • Number of attempts: 1
Reconstruct the Sentence - 1763 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 20
  • Position: #165 / 461
  • Number of attempts: 9
Whitespace, empty lines and tabs - 4083 entries

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

  • Best score: 7
  • Best player score: 17
  • Position: #185 / 872
  • Number of attempts: 12
Flodder-challenge - 1527 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 28
  • Position: #82 / 384
  • Number of attempts: 7
Simple text editing with Vim - 13682 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #2052 / 3920
  • Number of attempts: 7
Reformat/Refactor a Golfer Class - 7737 entries

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

  • Best score: 7
  • Best player score: 34
  • Position: #342 / 1901
  • Number of attempts: 10
Suhaib Murshid
Github:

entered into 32 challenges

contributed 0 challenges