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

convert yml into java pojo field - 688 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

  • Best score: 29
  • Best player score: 30
  • Number of attempts: 3
Swap the operands under comparison - 223 entries

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

  • Best score: 19
  • Best player score: 27
  • Number of attempts: 1
Enumerate words - 223 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 4
Interleave lines - 125 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: 24
  • Number of attempts: 2
Every other line - 2197 entries

AaAaAaA

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 4
One number per line - 13745 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 5
Simple, Practical, and Common - 26191 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: 22
  • Number of attempts: 5
Increment each number - 555 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 1
Words in parens - 11265 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 3
Just the middle - 9539 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 3
-a-b-c- - 2670 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 1
Sort files from hosts - 129 entries

Resume files by host. I hope you enjoy with this challenge

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 2
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 40 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

  • Best score: 18
  • Best player score: 19
  • Number of attempts: 1
Vice versa - 6132 entries

Little role switching.

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

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 2
Letter case trickery - 1450 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 12
  • Number of attempts: 1
Let's play some Ivmgolf - 926 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Number of attempts: 1
Collect List - 3577 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 17
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 9653 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Interweave two blocks of text - 498 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 8
Simple text editing with Vim - 10594 entries

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

  • Best score: 13
  • Best player score: 21
  • Number of attempts: 1
Swap values - 3684 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 1
ascii-art diamond - 32 entries

Simple ascii-art diamond. The grid is 40x40.

  • Best score: 40
  • Best player score: 41
  • Number of attempts: 1
Vertical Limit - 2148 entries

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

  • Best score: 21
  • Best player score: 22
  • Number of attempts: 8
I forgot quotes - 12407 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 2
Array transposition - 1704 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 2
multiple cursor alternative - 1143 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 5
Basic renumbering - 4767 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Number of attempts: 1

Contributed Challenges

replace 2nd column blanks with values in same column if blank - 183 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

Combines all items - 244 entries

For each line that starts with the same number I want to combine its contents

Sergio
Twitter:

Entusiasta do Software Livre, Espírita, esquerdista. Gosto muito de blogar e ouvir música

entered into 28 challenges

contributed 2 challenges