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

Migrated to Postgres! - 312 entries

Celebration completion of this project. https://github.com/igrigorik/vimgolf/pull/322

  • Best score: 26
  • Best player score: 38
  • Position: #104 / 122
  • Number of attempts: 1
Simple, Practical, and Common - 33385 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 26
  • Position: #3575 / 7364
  • Number of attempts: 3
Swap the operands under comparison - 270 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 20
  • Position: #27 / 98
  • Number of attempts: 6
Extract argument from function - 2314 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 13
  • Position: #55 / 744
  • Number of attempts: 10
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #212 / 1585
  • Number of attempts: 4
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #181 / 4164
  • Number of attempts: 6
Interleave lines - 158 entries

This is some kind of « paste -d'\n' c b a ». There are many ways to achieve this.. just find the shortest!

  • Best score: 17
  • Best player score: 29
  • Position: #32 / 58
  • Number of attempts: 2
Subtraction - 178 entries

Solve the equations.

  • Best score: 18
  • Best player score: 30
  • Position: #45 / 61
  • Number of attempts: 1
Don't know what this is - 1978 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: 14
  • Position: #287 / 578
  • Number of attempts: 3
Where should I put the Newline? - 863 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #49 / 431
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #378 / 3666
  • Number of attempts: 5
Number an outline - 249 entries

The indent and words are right, but the numbers are all wrong.

  • Best score: 25
  • Best player score: 66
  • Position: #56 / 75
  • Number of attempts: 1
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2598 / 3946
  • Number of attempts: 1
paste indent correction - JS - 102 entries

You copy some javascript code from a website and paste it into vim, it does not look good!

  • Best score: 16
  • Best player score: 16
  • Position: #18 / 57
  • Number of attempts: 2
Transposition - 82 entries

Transpose the original lines in separate columns, one for each line.

  • Best score: 31
  • Best player score: 40
  • Position: #12 / 30
  • Number of attempts: 3
Groups magic - 150 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • Position: #39 / 90
  • Number of attempts: 2
Create a pandoc compatible table - 182 entries

In [this vimcast][1], a featured gist from Tim Pope shows how to quickly make a simple table structure. How fast can you convert it to pandoc's markdown style? [1]: http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

  • Best score: 32
  • Best player score: 37
  • Position: #20 / 53
  • Number of attempts: 3
SFD-ROC: The Quick Brown Fox - 169 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 24
  • Best player score: 29
  • Position: #88 / 101
  • Number of attempts: 1
you're stuck on jQuery < 1.7 - 337 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

  • Best score: 25
  • Best player score: 27
  • Position: #40 / 111
  • Number of attempts: 5
Exchanging Quotes - 821 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 34
  • Position: #76 / 225
  • Number of attempts: 7
replacing each line of a block selection - 2947 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 20
  • Position: #233 / 768
  • Number of attempts: 4
Switch function arguments - 2082 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #422 / 652
  • Number of attempts: 3
Append semicolon after expressions - 1005 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #151 / 403
  • Number of attempts: 3
Reverse and double space - 489 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Position: #121 / 194
  • Number of attempts: 2
Remove noise from HTTP log - 695 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #14 / 270
  • Number of attempts: 2
constructor - 180 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 88
  • Position: #22 / 58
  • Number of attempts: 1
Remove semicolons after expressions - 628 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 8
  • Position: #156 / 258
  • Number of attempts: 2
un-C-escape string - 56 entries

Convert escape sequences to characters

  • Best score: 12
  • Best player score: 12
  • Position: #24 / 50
  • Number of attempts: 1
switch variable - 5036 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 15
  • Position: #1447 / 1736
  • Number of attempts: 3
The meaning - 558 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #92 / 356
  • Number of attempts: 1
Format the output - 145 entries

Sometimes your standard out is a little hard to read. Take this multilevel hash and make it human readable.

  • Best score: 35
  • Best player score: 60
  • Position: #28 / 39
  • Number of attempts: 5
Calculate the table totals - 132 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

  • Best score: 33
  • Best player score: 53
  • Position: #26 / 43
  • Number of attempts: 3
Ugly spreadsheet copy/paste to CSV - 973 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 50
  • Position: #145 / 185
  • Number of attempts: 1
Ruby 1.9 hashes - 1221 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 17
  • Position: #317 / 401
  • Number of attempts: 3
A Simple One - 1001 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: #353 / 643
  • Number of attempts: 1
Ruby 1.9 compat - 610 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 15
  • Position: #103 / 230
  • Number of attempts: 3
Get rid of html tags - 368 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 15
  • Best player score: 17
  • Position: #83 / 217
  • Number of attempts: 4
Deleting folded text - 341 entries

The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.

  • Best score: 17
  • Best player score: 21
  • Position: #70 / 113
  • Number of attempts: 4
Javier Blanco
Twitter:

Rastreador de herramientas, best practices, frameworks, etc., que faciliten el desarrollo y mantenimiento de proyectos web (Rails, jQuery, HAML, SQLite, ...)

entered into 38 challenges

contributed 0 challenges