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

swap number pairs - 1986 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 32
  • Position: #241 / 367
  • Number of attempts: 9
HS Final exam vimgolf - 852 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 42
  • Position: #190 / 224
  • Number of attempts: 3
Rural Post - 4342 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 13
  • Position: #585 / 1062
  • Number of attempts: 3
Simple, Practical, and Common - 33342 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: #3574 / 7355
  • Number of attempts: 5
One number per line - 18611 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 22
  • Position: #2696 / 3840
  • Number of attempts: 2
vim = 22 / 7 - 447 entries

pi square vim

  • Best score: 20
  • Best player score: 38
  • Position: #119 / 131
  • Number of attempts: 3
Swap values inside brackets - 2464 entries

Easy challenge.

  • Best score: 14
  • Best player score: 19
  • Position: #358 / 569
  • Number of attempts: 3
Add semicolons - 10780 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1234 / 3041
  • Number of attempts: 2
Box it - 7818 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #118 / 1861
  • Number of attempts: 5
Extract argument from function - 2308 entries

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

  • Best score: 13
  • Best player score: 20
  • Position: #682 / 742
  • Number of attempts: 1
Preferably without multi-cursor plugin - 538 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 42
  • Position: #109 / 127
  • Number of attempts: 1
ninja substitution - 1368 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 23
  • Position: #216 / 260
  • Number of attempts: 4
Cartesian product - 219 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 104
  • Position: #89 / 92
  • Number of attempts: 1
VimGolfNight - 531 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 15
  • Position: #302 / 342
  • Number of attempts: 2
I forgot quotes - 15918 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #2981 / 4158
  • Number of attempts: 1
Where should I put the Newline? - 859 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 9
  • Position: #407 / 430
  • Number of attempts: 1
Shuffle puzzle - 317 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 16
  • Position: #76 / 101
  • Number of attempts: 1
quotes inside quotes - 3121 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 17
  • Position: #702 / 1070
  • Number of attempts: 3
Recursive Cowsay - 58 entries

Convert 'cowsay' statement to recursive output

  • Best score: 33
  • Best player score: 56
  • Position: #13 / 17
  • Number of attempts: 1
Words in parens - 12848 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 24
  • Position: #3666 / 3943
  • Number of attempts: 2
Create a pandoc compatible table - 179 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: 81
  • Position: #50 / 52
  • Number of attempts: 1
Vertical Limit - 2426 entries

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

  • Best score: 21
  • Best player score: 27
  • Position: #496 / 733
  • Number of attempts: 5
Exchanging Quotes - 809 entries

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

  • Best score: 30
  • Best player score: 56
  • Position: #219 / 222
  • Number of attempts: 1
replacing each line of a block selection - 2923 entries

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

  • Best score: 18
  • Best player score: 33
  • Position: #692 / 763
  • Number of attempts: 3
Switch function arguments - 2050 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 33
  • Position: #641 / 644
  • Number of attempts: 1
Remove noise from HTTP log - 692 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: 20
  • Position: #245 / 269
  • Number of attempts: 1
Simple text editing with Vim - 12203 entries

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

  • Best score: 13
  • Best player score: 29
  • Position: #3247 / 3559
  • Number of attempts: 1

Contributed Challenges

Recursive Cowsay - 58 entries

Convert 'cowsay' statement to recursive output

swap number pairs - 1986 entries

Swap the numbers in a bunch of 2-element arrays.

Jan Wedekind
Twitter:

Computer science PhD dabbling with programming languages, machine vision, and free software

entered into 27 challenges

contributed 2 challenges