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 - 1631 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: #85 / 271
  • Number of attempts: 6
New teacher - 1419 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 26
  • Position: #159 / 299
  • Number of attempts: 1
Find fix point of cos - 1444 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: #240 / 427
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 572 entries

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

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

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

  • Best score: 14
  • Best player score: 19
  • Position: #301 / 570
  • Number of attempts: 1
Tabbed Table to Python Array - 755 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: #47 / 182
  • Number of attempts: 4
HS exam question - 1599 entries

Convert the data to a python dictionary

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

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #311 / 478
  • Number of attempts: 3
delete swap - 1818 entries

delete all swap

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

Simple number generation

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

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

  • Best score: 5
  • Best player score: 5
  • Position: #311 / 437
  • Number of attempts: 2
comment and uncomment code inline - 1151 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: #223 / 328
  • Number of attempts: 1
Just the middle - 11541 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3209 / 4230
  • Number of attempts: 1
Team names - 1848 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #285 / 592
  • Number of attempts: 3
Python Hello World! Reformatting - 1007 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 / 384
  • Number of attempts: 3
I forgot quotes - 16093 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2050 / 4202
  • Number of attempts: 1
learn vim in short time - 242 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 9
  • Position: #154 / 162
  • 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 - 1620 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 / 450
  • Number of attempts: 3
Switch function arguments - 2182 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #339 / 674
  • Number of attempts: 3
Shebangs for all - 2049 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: #166 / 523
  • Number of attempts: 6
A Simple One - 1067 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 / 671
  • Number of attempts: 1
Hatsuyume - 556 entries

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

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

entered into 24 challenges

contributed 0 challenges