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

CSV to JSON - 143 entries

A search for shortest vimissh way to convert CSV to JSON.

  • Best score: 56
  • Best player score: 155
  • Number of attempts: 2
Refactor static member invocation - 180 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

  • Best score: 28
  • Best player score: 50
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 5551 entries

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

  • Best score: 32
  • Best player score: 44
  • Number of attempts: 2
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: 2
-a-b-c- - 2670 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 1
Switch function arguments - 1843 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 3
Simple text editing with Vim - 10594 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 10
Reverse Simple Deletion - 720 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
V to the i - 4054 entries

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

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

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 495 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
I forgot quotes - 12407 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 5
Hole-in-one - 941 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: 19
  • Number of attempts: 4
Almost encrypted - 165 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Team names - 1498 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 5
Just the middle - 9539 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 10
learn vim in short time - 186 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 2
Letter case trickery - 1450 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 5
Happy TvvO - 354 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Simple, Practical, and Common - 26189 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 14
  • Best player score: 22
  • Number of attempts: 9
Make it more readable - 1765 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 4
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: 9
  • Number of attempts: 3
Search and Replace 0 - 4187 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 5
readability - 285 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 2
Wget failed to download redirections - 158 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 20
  • Number of attempts: 5
Increment, increment, increment.... - 492 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
The name of the game - 586 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Words in parens - 11265 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 4
Vice versa - 6132 entries

Little role switching.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 3
Get rid of html tags - 315 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 1
Swap the operands under comparison - 223 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 26
  • Number of attempts: 1
Let's play some Ivmgolf - 926 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 12
  • Number of attempts: 1
Swap values inside brackets - 1685 entries

Easy challenge.

  • Best score: 14
  • Best player score: 18
  • Number of attempts: 6
One number per line - 13745 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 9653 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
Hatsuyume - 365 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 16
  • Best player score: 24
  • Number of attempts: 1
Reverse characters in a line - 585 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 22
  • Number of attempts: 2
Numbering a List - 1746 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Number of attempts: 2
Extract argument from function - 2037 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 22
  • Number of attempts: 1
Number Sort - 245 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
Remove noise from HTTP log - 618 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: 17
  • Number of attempts: 3
Case preserving word replacement - 389 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 23
  • Number of attempts: 1
Reorder the groups - 570 entries

Change the order so that the groups of fruit come before the vegetables.

  • Best score: 14
  • Best player score: 23
  • Number of attempts: 2
Saving the hashes(#) - 1779 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: 27
  • Number of attempts: 5
Do you demand a shrubbery? - 1018 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 28
  • Number of attempts: 3
Split the words - 334 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: 36
  • Number of attempts: 3
Delete unwanted lines - 336 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Preferably without multi-cursor plugin - 303 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 39
  • Number of attempts: 3
Python Hello World! Reformatting - 837 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 42
  • Number of attempts: 9
Dr. Rev. J. "Paranoid Android" Kirchartz
Twitter:

Post-Post-Modern Renaissance man. #botALLY #SubGenius #Pope *Burgh Verified* maker of @yinzbot, @WebYinzer, https://t.co/qhd7qT8Dj9

entered into 49 challenges

contributed 0 challenges