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

html paragraph to table - 451 entries

reformat html paragraph to table

  • Best score: 7
  • Best player score: 69
  • Number of attempts: 1
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: 1
multiple cursor alternative - 1175 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 35
  • Number of attempts: 3
Simple, Practical, and Common - 26788 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: 22
  • Best player score: 28
  • Number of attempts: 3
Whitespace, empty lines and tabs - 2599 entries

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

  • Best score: 16
  • Best player score: 27
  • Number of attempts: 2
switch variable - 4443 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 1
V to the i - 4104 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 4
Collect List - 3613 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 18
  • Number of attempts: 2
remove lines containing the word "reader" - 2174 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • 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: 14
  • Number of attempts: 1
One to Ten - 1278 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 6
Just the middle - 9665 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Com(m)a Trouble - 2090 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 34
  • Number of attempts: 2
Simple text editing with Vim - 10672 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: 10
Unsemantic linewrapping - 470 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 7
Swap values inside brackets - 1750 entries

Easy challenge.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 7
That hyphen - 2250 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 14
  • Number of attempts: 1
Copy three lines - 2237 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 8
-a-b-c- - 2689 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 3
One number per line - 14139 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 11
quotes inside quotes - 2834 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: 16
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 5569 entries

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

  • Best score: 32
  • Best player score: 43
  • Number of attempts: 2
Every other line - 2232 entries

AaAaAaA

  • Best score: 12
  • Best player score: 18
  • Number of attempts: 2
Add semicolons - 4293 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 5
Don't know what this is - 1805 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: 16
  • Number of attempts: 2
Extract argument from function - 2049 entries

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

  • Best score: 13
  • Best player score: 23
  • Number of attempts: 1
Box it - 4229 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Number of attempts: 8
I forgot quotes - 12707 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Number of attempts: 3
Split line with dots - 1916 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 26
  • Number of attempts: 4
Christian
Twitter:

entered into 29 challenges

contributed 0 challenges