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

Cartesian product - 201 entries

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

  • Best score: 24
  • Best player score: 104
  • Number of attempts: 1
Box it - 3842 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 5
Extract argument from function - 2037 entries

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

  • Best score: 13
  • Best player score: 20
  • Number of attempts: 1
Switch function arguments - 1843 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 33
  • Number of attempts: 1
vim = 22 / 7 - 398 entries

pi square vim

  • Best score: 20
  • Best player score: 38
  • Number of attempts: 3
Remove noise from HTTP log - 618 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
  • Number of attempts: 1
ninja substitution - 692 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 23
  • Number of attempts: 4
Words in parens - 11260 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 24
  • Number of attempts: 2
Where should I put the Newline? - 798 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 1
One number per line - 13715 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 22
  • Number of attempts: 1
VimGolfNight - 458 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 2
Swap values inside brackets - 1685 entries

Easy challenge.

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 3
I forgot quotes - 12373 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Number of attempts: 1
Preferably without multi-cursor plugin - 297 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
  • Number of attempts: 1
quotes inside quotes - 2826 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
  • Number of attempts: 3
replacing each line of a block selection - 2569 entries

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

  • Best score: 18
  • Best player score: 33
  • Number of attempts: 3
Shuffle puzzle - 289 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
  • Number of attempts: 1
Simple, Practical, and Common - 26168 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: 14
  • Best player score: 26
  • Number of attempts: 4
Vertical Limit - 2148 entries

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

  • Best score: 21
  • Best player score: 27
  • Number of attempts: 5
Create a pandoc compatible table - 158 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
  • Number of attempts: 1
Simple text editing with Vim - 10593 entries

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

  • Best score: 13
  • Best player score: 29
  • Number of attempts: 1
Recursive Cowsay - 49 entries

Convert 'cowsay' statement to recursive output

  • Best score: 33
  • Best player score: 56
  • Number of attempts: 1
Exchanging Quotes - 761 entries

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

  • Best score: 30
  • Best player score: 56
  • Number of attempts: 1

Contributed Challenges

Recursive Cowsay - 49 entries

Convert 'cowsay' statement to recursive output

Jan Wedekind
Twitter:

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

entered into 23 challenges

contributed 1 challenges