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 - 1515 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: #81 / 251
  • Number of attempts: 6
New teacher - 1364 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 26
  • Position: #153 / 285
  • Number of attempts: 1
Find fix point of cos - 1426 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 / 422
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 567 entries

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

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

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

  • Best score: 14
  • Best player score: 19
  • Position: #296 / 565
  • Number of attempts: 1
Tabbed Table to Python Array - 743 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 / 180
  • Number of attempts: 4
HS exam question - 1596 entries

Convert the data to a python dictionary

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

Quick and easy

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

delete all swap

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

Simple number generation

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

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

  • Best score: 5
  • Best player score: 5
  • Position: #311 / 426
  • 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 - 11500 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3205 / 4216
  • 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 - 1006 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 / 383
  • Number of attempts: 3
I forgot quotes - 16051 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2047 / 4194
  • 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 - 1616 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 / 447
  • Number of attempts: 3
Switch function arguments - 2152 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #337 / 667
  • Number of attempts: 3
Shebangs for all - 2046 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 / 522
  • Number of attempts: 6
A Simple One - 1064 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 / 670
  • Number of attempts: 1
Hatsuyume - 548 entries

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

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

entered into 24 challenges

contributed 0 challenges