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

Five Pillars - 43 entries

Arrange all words in a table with 5 columns. The minimal space between words in columns is 2 spaces. Columns do have varying width.

  • Best score: 41
  • Best player score: 71
  • Number of attempts: 4
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: 65
  • Number of attempts: 1
Replace Parameter with Explicit Methods - 61 entries

Implementing the methods of a Java Interface

  • Best score: 33
  • Best player score: 49
  • Number of attempts: 2
Test everything! - 111 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 34
  • Number of attempts: 2
Exchanging Quotes - 756 entries

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

  • Best score: 30
  • Best player score: 34
  • Number of attempts: 3
attr_aligner - 2957 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 32
  • Number of attempts: 4
Pretty format for variable declarations - 128 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 7
Change name of a variable - 145 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: 9
  • Number of attempts: 1
Do you demand a shrubbery? - 1001 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 5
VimGolfNight - 456 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
increment by column in XML - 138 entries

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

  • Best score: 19
  • Best player score: 20
  • Number of attempts: 4
Append semicolon after expressions - 843 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Where should I put the Newline? - 788 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Count both ways - 859 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
C to VimDict - 38 entries

Convert a C data structure to a Vimscript dictionary.

  • Best score: 39
  • Best player score: 42
  • Number of attempts: 6
switch variable - 4244 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 13
  • Number of attempts: 1
V to the i - 3800 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 4
Simple text editing with Vim - 10277 entries

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

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

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 5
The Cake is a Lie - 1111 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Let's play some Ivmgolf - 890 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Just the middle - 8977 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 4
Winning streak - 105 entries

Make the number on each line equal the consecutive L's or W's.

  • Best score: 21
  • Best player score: 37
  • Number of attempts: 1
Happy TvvO - 347 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Shuffle puzzle - 289 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
Letter case trickery - 1426 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: 3
fib.c cleanup - 54 entries

cleanup the file

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 2
learn vim in short time - 183 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 3
vim1001 - 227 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

  • Best score: 17
  • Best player score: 21
  • Number of attempts: 2
Words in parens - 10843 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 7
Condensed Cases - 675 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: 17
  • Number of attempts: 3
Basic renumbering - 4508 entries

Renumbering Basic.

  • Best score: 2
  • Best player score: 14
  • Number of attempts: 3
quotes inside quotes - 2726 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: 2
  • Best player score: 15
  • Number of attempts: 2
Binary and Increment - 39 entries

Some numbers fun: not only increasing numbers but also increasing binary.

  • Best score: 23
  • Best player score: 24
  • Number of attempts: 2
-a-b-c- - 2530 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 2
Lisp Condense - 371 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
Shift down - 168 entries

Number words are back.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 4
SFD-ROC: vimvimvim - 1265 entries

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

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 5
Make it more readable - 1738 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
A Simple One - 832 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
That hyphen - 2125 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 16
  • Number of attempts: 4
Going underground.... - 283 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 33
  • Number of attempts: 3
range(10) digit rotation - 32 entries

This is a data generator challenge or some kind of gift..

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 1
I forgot quotes - 11370 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 4
Minimalist Limerick - 448 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 32
  • Number of attempts: 5
Hole-in-one - 935 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: 21
  • Number of attempts: 2
Change the content of a string - 1222 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Number of attempts: 4
Search and Replace 0 - 4019 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 3
Separating firstname & lastname - 102 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 22
  • Number of attempts: 2
Whitespace, empty lines and tabs - 2529 entries

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

  • Best score: 16
  • Best player score: 26
  • Number of attempts: 3
Switch function arguments - 1815 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Vertical Limit - 2097 entries

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

  • Best score: 21
  • Best player score: 26
  • Number of attempts: 2
Don't know what this is - 1711 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: 14
  • Number of attempts: 2
replacing each line of a block selection - 2475 entries

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

  • Best score: 17
  • Best player score: 19
  • Number of attempts: 7
Saving the hashes(#) - 1709 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: 3
Jake Eskel
Twitter:

A proud conservative, high-school homeschooler, and a multi-lingual programmer.

entered into 55 challenges

contributed 0 challenges