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

Stairs Indenting - 384 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
swap or reverse - 91 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 2
Vertical Limit - 2230 entries

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

  • Best score: 21
  • Best player score: 26
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10083 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Context insensitive completion 0 - 450 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Number of attempts: 1
V to the i - 4338 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Hanging Indent for Footnotes - 58 entries

Format this footnote (in kramdown syntax) so that it has hanging indent.

  • Best score: 17
  • Best player score: 20
  • Number of attempts: 5
That hyphen - 2376 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Append semicolon after expressions - 892 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Just the middle - 10337 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
Reverse Simple Deletion - 732 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 1
Don't know what this is - 1867 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: 13
  • Number of attempts: 2
Space out the alphabet - 1463 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 4
NATO phonetic alphabet - 410 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 2
Add fold markers to a .c file - 443 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 30
  • Best player score: 38
  • Number of attempts: 1
switch variable - 4614 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
HTML to Haml - 746 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 30
  • Number of attempts: 7
Reformat most common surnames - 537 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 43
  • Number of attempts: 1
Numbering a List - 1760 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 6
imports alignment (python) - 583 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 25
  • Number of attempts: 1
ASCII box - 302 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 27
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1337 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: 6
Gray area - 664 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
Search and Replace 0 - 4434 entries

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

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

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 4
Basic renumbering - 5088 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 8
-a-b-c- - 2863 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 1
Remove semicolons after expressions - 488 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 8
  • Number of attempts: 1
Restore order to the alphabet - 155 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 3
I forgot quotes - 14291 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 2
quotes inside quotes - 2942 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: 15
  • Number of attempts: 4
Increment, increment, increment.... - 507 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 2
Switch function arguments - 1876 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Simple text editing with Vim - 11007 entries

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

  • Best score: 13
  • Best player score: 18
  • Number of attempts: 1
Reverse characters in a line - 601 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: 15
  • Number of attempts: 1
Let's play some Ivmgolf - 968 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 1
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
Wget failed to download redirections - 168 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: 32
  • Number of attempts: 2
camel riding - 727 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 3
Condensed Cases - 728 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: 13
  • Number of attempts: 4
Reformat a C golf submission - 488 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 28
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5661 entries

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

  • Best score: 32
  • Best player score: 34
  • Number of attempts: 4
remove all lines in first part - 149 entries

From the second part, remove all lines in the first part. It can be useful when you have done something from a long list, you want to know what is not done yet!

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 3
Words in parens - 11996 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 2
Skúli Jóhannsson
Twitter:

entered into 44 challenges

contributed 0 challenges