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

ASCII box - 303 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 23
  • Number of attempts: 4
Do you demand a shrubbery? - 1042 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 10
A HAPPY NEW YEAR 2014 ! - 10180 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 6
V to the i - 4422 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Entries sort - 71 entries

It cames to my mind a weird idea : sorting parts of my .vimrc. Take few minutes to sort out this, it's easy !

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 2
A Simple One - 854 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
  • Number of attempts: 1
Vertical Limit - 2243 entries

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

  • Best score: 21
  • Best player score: 23
  • Number of attempts: 7
Don't know what this is - 1876 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 6
Space out the alphabet - 1479 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 7
Where should I put the Newline? - 830 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
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: 28
  • Number of attempts: 3
That hyphen - 2397 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 6
readability - 292 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 3
VimGolfNight - 471 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
switch variable - 4696 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
Make HTML List - 923 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 36
  • Number of attempts: 6
learn vim in short time - 196 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 1
Gray area - 669 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
Make it more readable - 1812 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
The Cake is a Lie - 1166 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
-a-b-c- - 2925 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 5
Shuffled numbers - 203 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 4
Restore order to the alphabet - 161 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
replacing each line of a block selection - 2704 entries

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

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 12
Basic renumbering - 5186 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 18
  • Number of attempts: 7
quotes inside quotes - 2952 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: 14
  • Number of attempts: 4
Mess in revision history - 1074 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 21
  • Number of attempts: 7
Line 'em up! - 304 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 7
lamb had a little Mary - 535 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 34
  • Number of attempts: 5
Count both ways - 921 entries

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
Hole-in-one - 963 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 7
Sorting database text output - 194 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

  • Best score: 24
  • Best player score: 24
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5698 entries

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

  • Best score: 32
  • Best player score: 32
  • Number of attempts: 12
Condensed Cases - 729 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: 12
  • Number of attempts: 6
Split the words - 345 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

  • Best score: 18
  • Best player score: 40
  • Number of attempts: 2
camel riding - 731 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 4
Mute the second method of this script - 418 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Search and Replace 0 - 4450 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 7
Reconstruct the Sentence - 1038 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
  • Number of attempts: 6
Fix the XML - 904 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 22
  • Number of attempts: 7
Braces or Brackets? - 644 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 43
  • Number of attempts: 6
Liam Thurston
Twitter:

entered into 41 challenges

contributed 0 challenges