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

Saving the hashes(#) - 1770 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
Basic renumbering - 4756 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Just the middle - 9523 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 10
  • Number of attempts: 1
Words in parens - 11250 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 1
comments galore - 910 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Swap values - 3672 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 1
Split line with dots - 1894 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 21
  • Number of attempts: 1
I forgot quotes - 12353 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 4
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
switch variable - 4376 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • 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: 2
One number per line - 13705 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Number of attempts: 1
Shebangs for all - 1618 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
That hyphen - 2220 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Don't know what this is - 1787 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
comment and uncomment code inline - 843 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
Collect List - 3575 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Search and Replace 0 - 4187 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
-a-b-c- - 2670 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Copy three lines - 2208 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
Generate a list of numbers - 250 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 1
From argument to object - 1121 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
Simple text editing with Vim - 10592 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
multiple cursor alternative - 1143 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
Chris Dean
Twitter:

entered into 24 challenges

contributed 0 challenges