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(#) - 1806 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 - 4854 entries

Renumbering Basic.

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

Delete the instructions at the top and bottom.

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

We should all ace this, right?

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

Basic comment reformatting

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

Well, swap the values...

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

This line is too long, split it.

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

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 4
V to the i - 4150 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
switch variable - 4451 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 1
Number Sort - 255 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 - 14410 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Number of attempts: 1
Shebangs for all - 1643 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 - 2263 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Don't know what this is - 1809 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 - 863 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 - 3634 entries

Convert to comma separated list.

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

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

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

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Copy three lines - 2256 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 - 254 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 - 1135 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 - 10703 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 - 1179 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