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

Vice versa - 6936 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 7
camel riding - 731 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10151 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Condensed Cases - 729 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
Learn some german verbs - 421 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 28
  • Number of attempts: 1
Vertical Limit - 2243 entries

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

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 8
attr_aligner - 3245 entries

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

  • Best score: 19
  • Best player score: 32
  • Number of attempts: 4
Preferably without multi-cursor plugin - 368 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: 32
  • Number of attempts: 6
Don't know what this is - 1872 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 7
Add links to an existing HTML table - 59 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

  • Best score: 42
  • Best player score: 43
  • Number of attempts: 4
Execute immediate SQL - 82 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 70
  • Number of attempts: 4
CSV to JSON - 143 entries

A search for shortest vimissh way to convert CSV to JSON.

  • Best score: 56
  • Best player score: 76
  • Number of attempts: 6
Array transposition - 2020 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 7
Swap values - 4201 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 5
Make HTML List - 923 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 41
  • Number of attempts: 2
switch variable - 4666 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
HTML to Haml - 757 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 43
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1381 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Number of attempts: 6
Collect List - 3932 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 2
Simple text editing with Vim - 11067 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 13
Exchanging Quotes - 777 entries

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

  • Best score: 30
  • Best player score: 31
  • Number of attempts: 8
Add semicolons - 8294 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 3
Search and Replace 0 - 4446 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 5
Line 'em up! - 280 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 4
Swap assigned value - 518 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 8
I forgot quotes - 14515 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 6
Hello ${world} - 254 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

  • Best score: 24
  • Best player score: 25
  • Number of attempts: 4
Switch function arguments - 1888 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 5
replacing each line of a block selection - 2694 entries

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

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 11
Change the content of a string - 1267 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 7
Replace and keep the case - 369 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 27
  • Number of attempts: 7
Interweave two blocks of text - 522 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: 16
  • Number of attempts: 7
Python: Lots of function arguments - 73 entries

The function definition is too long for one line. The modeline helps you with some typical Python indent settings.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
Words in parens - 12094 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 2
Fix the XML - 904 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 11
Remove noise from HTTP log - 624 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: 16
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 5694 entries

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

  • Best score: 32
  • Best player score: 32
  • Number of attempts: 14
Simple, Practical, and Common - 30439 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
  • Number of attempts: 11
multiple cursor alternative - 1359 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: 21
  • Number of attempts: 3
Fran├žois Marais
Twitter:

#emacs devotee

entered into 39 challenges

contributed 0 challenges