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

Add semicolons - 10209 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 2
Box it - 7573 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 5
One to Ten - 2027 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: 4
remove lines containing the word "reader" - 3400 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Number Sort - 268 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: 2
multiple cursor alternative - 1409 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: 19
  • Number of attempts: 5
From argument to object - 1245 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 3
comment and uncomment code inline - 971 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Generate a list of numbers - 262 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 1
Copy three lines - 2744 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: 7
Split line with dots - 2074 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 21
  • Number of attempts: 1
One number per line - 18165 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Number of attempts: 2
Swap values - 4373 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 1
comments galore - 942 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Collect List - 4137 entries

Convert to comma separated list.

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

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
I forgot quotes - 15602 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 4
Basic renumbering - 5389 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
That hyphen - 2456 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
-a-b-c- - 3076 entries

Put hyphens everywhere.

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

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Don't know what this is - 1903 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
Words in parens - 12671 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Saving the hashes(#) - 1920 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: 26
  • Number of attempts: 3
switch variable - 4859 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 1
Shebangs for all - 1718 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

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

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Simple text editing with Vim - 11327 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: 2
Chris Dean
Twitter:

entered into 28 challenges

contributed 0 challenges