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

Add links to an existing HTML table - 59 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

  • Best score: 42
  • Best player score: 104
  • Number of attempts: 1
Make the circuit grid! - 71 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: 89
  • Number of attempts: 2
Exchanging Quotes - 761 entries

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

  • Best score: 30
  • Best player score: 53
  • Number of attempts: 4
Convert pandoc unordered list to a numbered list - 136 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: 51
  • Number of attempts: 2
Extract text from xml - 101 entries

Extract text from xml file (ignoring commented out elements) and create a one line regex.

  • Best score: 28
  • Best player score: 46
  • Number of attempts: 4
Minimalist Limerick - 481 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 41
  • Number of attempts: 4
Readable Rubyhash - 232 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: 23
  • Best player score: 38
  • Number of attempts: 5
Vertical Limit - 2167 entries

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

  • Best score: 21
  • Best player score: 38
  • Number of attempts: 3
Inconsistent real estate paste - 142 entries

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

  • Best score: 24
  • Best player score: 60
  • Number of attempts: 3
Rotating Philosophers Problem - 358 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

  • Best score: 29
  • Best player score: 36
  • Number of attempts: 2
Define to require - 113 entries

When JSHint is enabled, there's a rule that doesn't let you have more than 6 arguments in a function, so the moment you need to add a 7th argument, you need to do a refactoring.

  • Best score: 62
  • Best player score: 119
  • Number of attempts: 3
Saving the hashes(#) - 1806 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: 34
  • Number of attempts: 1
Python: Lots of function arguments - 73 entries

The function definition is too long for one line. The modeline helps you with some typical Python indent settings.

  • Best score: 13
  • Best player score: 31
  • Number of attempts: 2
Enumerate words - 223 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 30
  • Number of attempts: 1
The name of the game - 587 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 3
Sorting a glossary - 101 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 1
Change name of a variable - 146 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 2
SFD-ROC: ROT13 Phonics - 70 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 1
Let's play some Ivmgolf - 937 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Number of attempts: 3
Unwrap the text of an email message - 150 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 36
  • Number of attempts: 3
I forgot quotes - 12713 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Number of attempts: 3
Refactor arguments into object argument - 157 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 75
  • Number of attempts: 3
Simple text editing with Vim - 10674 entries

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

  • Best score: 13
  • Best player score: 39
  • Number of attempts: 2
SFD-ROC: The Quick Brown Fox - 140 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 25
  • Best player score: 28
  • Number of attempts: 1
NATO phonetic alphabet - 407 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 41
  • Number of attempts: 2
VimGolfNight - 463 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Make it more readable - 1769 entries

Insert blank lines to make it more organized and readable

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

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

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

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 330 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 4
Prefixes and suffixes - 506 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 33
  • Number of attempts: 1
Where should I put the Newline? - 802 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1305 entries

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

  • Best score: 8
  • Best player score: 14
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 9723 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 1
Groups magic - 136 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 18
  • Number of attempts: 1
Words in parens - 11370 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 1
Stairs Indenting - 360 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 19
  • Number of attempts: 2
Condensed Cases - 698 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 19
  • Number of attempts: 1
Just the middle - 9678 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 2
A simple change - 362 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 21
  • Number of attempts: 2
Swap assigned value - 499 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 2
Checkerboard case pattern - 106 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 25
  • Number of attempts: 2
Ravi S Sinha
Twitter:

Passionate polyglot software developer, researcher, scientist, open sourcer, fitness enthusiast, trilingual. Work in progress. @IBM Watson. Opinions are my own.

entered into 42 challenges

contributed 0 challenges