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

Simple, Practical, and Common - 33353 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: 22
  • Position: #1039 / 7358
  • Number of attempts: 6
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #764 / 1585
  • Number of attempts: 6
Create Leading Zeros - 232 entries

Create leading zeros only for id columns. Please use generic approach!

  • Best score: 23
  • Best player score: 24
  • Position: #18 / 79
  • Number of attempts: 5
VimGolfNight - 531 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #94 / 342
  • Number of attempts: 2
Split the words - 356 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

  • Best score: 18
  • Best player score: 20
  • Position: #12 / 108
  • Number of attempts: 8
Permutations N=4 - 60 entries

Could use backtracking or other algorithm to generate sorted numbers. Second chance !

  • Best score: 25
  • Best player score: 53
  • Position: #16 / 18
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #460 / 3663
  • Number of attempts: 5
attr_aligner - 3444 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 19
  • Position: #15 / 692
  • Number of attempts: 5
Number an outline - 246 entries

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

  • Best score: 25
  • Best player score: 30
  • Position: #11 / 74
  • Number of attempts: 4
Words in parens - 12848 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #131 / 3943
  • Number of attempts: 3
Pairs of numbers - 349 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 27
  • Position: #22 / 132
  • Number of attempts: 5
Block Fun 1 - 188 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 19
  • Position: #26 / 72
  • Number of attempts: 3
Sort by your own sum - 69 entries

Same numbers as last time, but you'll have to add them yourself.

  • Best score: 25
  • Best player score: 32
  • Position: #11 / 27
  • Number of attempts: 2
abcd > a b c d - 279 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #111 / 217
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 400 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 11
  • Position: #127 / 187
  • Number of attempts: 2
The name of the game - 646 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #145 / 354
  • Number of attempts: 2
Saving the hashes(#) - 1992 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: 25
  • Position: #162 / 473
  • Number of attempts: 4
Let's play some Ivmgolf - 1084 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #210 / 440
  • Number of attempts: 2
Vertical Limit - 2436 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 22
  • Position: #135 / 735
  • Number of attempts: 5
replacing each line of a block selection - 2925 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #142 / 764
  • Number of attempts: 3
Switch function arguments - 2064 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #241 / 647
  • Number of attempts: 3
switch variable - 5028 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #764 / 1734
  • Number of attempts: 3
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #153 / 640
  • Number of attempts: 5
remove dupes from array - 1332 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 17
  • Position: #52 / 330
  • Number of attempts: 11
Before there was Farmville... - 97 entries

There was old MacDonald. For my toddler. The first Vim sing-a-long?

  • Best score: 156
  • Best player score: 239
  • Position: #37 / 47
  • Number of attempts: 1
Numbering a List - 1855 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Position: #122 / 638
  • Number of attempts: 5
Add fold markers to a .c file - 550 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 30
  • Best player score: 31
  • Position: #52 / 170
  • Number of attempts: 5
Whitespace, empty lines and tabs - 3288 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 17
  • Position: #81 / 728
  • Number of attempts: 9
Simple text editing with Vim - 12232 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #1119 / 3567
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6511 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 33
  • Position: #231 / 1602
  • Number of attempts: 8
thasso
Twitter:

entered into 30 challenges

contributed 0 challenges