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

Rearrange array to single level - 1396 entries

The goal is to flatten the array into a single list and remove any empty elements.

  • Best score: 14
  • Best player score: 21
  • Position: #76 / 229
  • Number of attempts: 6
New teacher - 1101 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 26
  • Position: #130 / 236
  • Number of attempts: 1
Find fix point of cos - 1408 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 15
  • Position: #238 / 418
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 561 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #220 / 314
  • Number of attempts: 2
Paste a column after a column - 2555 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 19
  • Position: #291 / 557
  • Number of attempts: 1
Tabbed Table to Python Array - 735 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 54
  • Position: #46 / 179
  • Number of attempts: 4
HS exam question - 1589 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 48
  • Position: #43 / 417
  • Number of attempts: 5
Many duplicates - 1447 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #310 / 470
  • Number of attempts: 3
delete swap - 1788 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #374 / 557
  • Number of attempts: 1
hello-world-vimgolf - 2501 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #339 / 709
  • Number of attempts: 3
Wrap the text of an email message to 79 characters - 799 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #311 / 421
  • Number of attempts: 2
comment and uncomment code inline - 1124 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: 10
  • Position: #219 / 323
  • Number of attempts: 1
Just the middle - 11484 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3203 / 4209
  • Number of attempts: 1
Team names - 1841 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #285 / 589
  • Number of attempts: 3
Python Hello World! Reformatting - 1000 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 39
  • Position: #9 / 382
  • Number of attempts: 3
I forgot quotes - 16022 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2045 / 4189
  • Number of attempts: 1
learn vim in short time - 240 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 9
  • Position: #154 / 161
  • Number of attempts: 1
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #279 / 354
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1606 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 8
  • Position: #132 / 446
  • Number of attempts: 3
Switch function arguments - 2140 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #336 / 664
  • Number of attempts: 3
Shebangs for all - 2018 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
  • Position: #164 / 519
  • Number of attempts: 6
A Simple One - 1057 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #576 / 667
  • Number of attempts: 1
Hatsuyume - 540 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 15
  • Best player score: 16
  • Position: #15 / 187
  • Number of attempts: 4
Context insensitive completion 0 - 585 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
  • Position: #126 / 248
  • Number of attempts: 5
Prem Netsuwan
Github:

entered into 24 challenges

contributed 0 challenges