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

Simple, Practical, and Common - 33073 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
  • Position: #1489 / 7295
  • Number of attempts: 4
Swap values - 4484 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 18
  • Position: #1116 / 1245
  • Number of attempts: 1
One number per line - 18472 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 15
  • Position: #760 / 3807
  • Number of attempts: 10
Swap values inside brackets - 2441 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Position: #149 / 564
  • Number of attempts: 9
V to the i - 4647 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Position: #898 / 1861
  • Number of attempts: 1
Com(m)a Trouble - 3477 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 13
  • Position: #183 / 779
  • Number of attempts: 5
Wrap the text of an email message to 79 characters - 631 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #117 / 368
  • Number of attempts: 2
multiple cursor alternative - 1452 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: 26
  • Position: #303 / 371
  • Number of attempts: 2
From argument to object - 1441 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 19
  • Position: #266 / 441
  • Number of attempts: 1
Every other line - 2850 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #440 / 690
  • Number of attempts: 3
Just the middle - 11284 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #751 / 4140
  • Number of attempts: 4
Team names - 1789 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #184 / 574
  • Number of attempts: 5
Stairstep digits - 362 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #87 / 136
  • Number of attempts: 1
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 53 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: 18
  • Position: #3 / 32
  • Number of attempts: 2
create arrows in a list - 92 entries

Add arrow at same distance

  • Best score: 10
  • Best player score: 10
  • Position: #27 / 65
  • Number of attempts: 1
7th Birthday - 185 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 24
  • Position: #44 / 72
  • Number of attempts: 3
Array transposition - 2321 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 17
  • Position: #124 / 434
  • Number of attempts: 7
convert yml into java pojo field - 825 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: 29
  • Position: #37 / 221
  • Number of attempts: 4
unknown command - 149 entries

I want change 5 words

  • Best score: 7
  • Best player score: 7
  • Position: #3 / 76
  • Number of attempts: 1
Logging with key - 299 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 38
  • Position: #71 / 85
  • Number of attempts: 1
I forgot quotes - 15822 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2551 / 4129
  • Number of attempts: 2
-a-b-c- - 3135 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #478 / 1118
  • Number of attempts: 1
Count both ways - 982 entries

Right AND down.

  • Best score: 13
  • Best player score: 17
  • Position: #282 / 346
  • Number of attempts: 1
Gray area - 712 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 16
  • Position: #246 / 264
  • Number of attempts: 1
Do you demand a shrubbery? - 1107 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 20
  • Position: #163 / 292
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10562 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1894 / 3646
  • Number of attempts: 2
Resort and deup a CSV list - 135 entries

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

  • Best score: 44
  • Best player score: 66
  • Position: #25 / 37
  • Number of attempts: 3
Cleanining up 80 column concatenated text - 185 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 49
  • Position: #59 / 74
  • Number of attempts: 1
Convert pandoc unordered list to a numbered list - 157 entries

I know it's possible to use #. in pandoc to auto-generate numbered lists, but then it's not easy to tell how many items there are when reading it in Markdown. How fast can you make the switch?

  • Best score: 20
  • Best player score: 25
  • Position: #26 / 55
  • Number of attempts: 1
Let's play some Ivmgolf - 1044 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #194 / 427
  • Number of attempts: 1
Inconsistent real estate paste - 178 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 45
  • Position: #38 / 53
  • Number of attempts: 2
Vertical Limit - 2386 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #298 / 723
  • Number of attempts: 3
Switch function arguments - 1996 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 16
  • Position: #560 / 632
  • Number of attempts: 1
Append semicolon after expressions - 975 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #18 / 394
  • Number of attempts: 3
Remove noise from HTTP log - 668 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: 15
  • Position: #34 / 264
  • Number of attempts: 5
Remove semicolons after expressions - 580 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #27 / 245
  • Number of attempts: 2
Make it more readable - 1925 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 19
  • Position: #533 / 633
  • Number of attempts: 2
Reformat long lines - 329 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

  • Best score: 15
  • Best player score: 16
  • Position: #34 / 129
  • Number of attempts: 4
Reverse Simple Deletion - 811 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #232 / 445
  • Number of attempts: 1
Sebastian Korten
Twitter:

Somebody somewhere sometimes...

entered into 39 challenges

contributed 0 challenges