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

A simple change - 376 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 2
Swap assigned value - 518 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 3
Groups magic - 139 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
  • Number of attempts: 3
abcd > a b c d - 248 entries

transform the single spaces into 4 spaces repeat for each line

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

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 4
Parsing with CSV: Unify lines and result. - 163 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

  • Best score: 21
  • Best player score: 25
  • Number of attempts: 1
That hyphen - 2397 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 17
  • Number of attempts: 1
Prefixes and suffixes - 526 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 26
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2728 entries

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

  • Best score: 16
  • Best player score: 36
  • Number of attempts: 1
lamb had a little Mary - 535 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 39
  • Number of attempts: 2
replacing each line of a block selection - 2704 entries

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

  • Best score: 18
  • Best player score: 29
  • Number of attempts: 1
Simple text editing with Vim - 11097 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 8
Saving the hashes(#) - 1876 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: 27
  • Number of attempts: 4
Block Fun 1 - 160 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 24
  • Number of attempts: 1
Refactor arguments into object argument - 159 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 72
  • Number of attempts: 1
-a-b-c- - 2925 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 3
Execute immediate SQL - 82 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 84
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10180 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
CY
Twitter:

entered into 18 challenges

contributed 0 challenges