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

Paste a column after a column - 2557 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 34
  • Position: #431 / 558
  • Number of attempts: 7
delete swap - 1788 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #199 / 557
  • Number of attempts: 1
Put a newline after every 10 lines in vim - 1660 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 11
  • Position: #164 / 558
  • Number of attempts: 8
hello-world-vimgolf - 2501 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #408 / 709
  • Number of attempts: 5
Making 3 line function a one liner. - 329 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #125 / 206
  • Number of attempts: 1
HS Final exam vimgolf - 904 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 37
  • Position: #185 / 238
  • Number of attempts: 2
Rural Post - 4551 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 13
  • Position: #668 / 1110
  • Number of attempts: 4
Levenshtein distance - 105 entries

Compute distance for each pair. Notice that this recursive implementation is very inefficient. Wagner-Fischer algorithm is iterative and much faster. #vimscript

  • Best score: 27
  • Best player score: 44
  • Position: #35 / 37
  • Number of attempts: 2
Add quotes to ansible playbook - 1007 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 9
  • Position: #196 / 316
  • Number of attempts: 4
Multiline to Single Line - 735 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #217 / 311
  • Number of attempts: 1
xrandr outputs and dashes - 716 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 31
  • Position: #218 / 224
  • Number of attempts: 1
Yo To Hello - 1144 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #378 / 530
  • Number of attempts: 1
Simple, Practical, and Common - 33742 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: 29
  • Position: #4999 / 7447
  • Number of attempts: 2
Swap values - 4643 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #524 / 1274
  • Number of attempts: 10
prepend * to every non-blank line - 6353 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 16
  • Position: #1097 / 1549
  • Number of attempts: 1
One number per line - 18776 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 19
  • Position: #2019 / 3875
  • Number of attempts: 6
V to the i - 4818 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1492 / 1898
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #487 / 701
  • Number of attempts: 2
Stairstep digits - 398 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 14
  • Position: #138 / 146
  • Number of attempts: 4
Fiddle percentages into real numbers - 869 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 45
  • Position: #291 / 293
  • Number of attempts: 3
One to Ten - 2227 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 12
  • Position: #351 / 677
  • Number of attempts: 3
Swap assigned value - 655 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #104 / 256
  • Number of attempts: 5
VimGolfNight - 570 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #288 / 350
  • Number of attempts: 3
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #1040 / 1138
  • Number of attempts: 1
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #278 / 354
  • Number of attempts: 3
NBCU Weekly Challenge - Test - 253 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #62 / 116
  • Number of attempts: 6
Change name of a variable - 179 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Position: #126 / 137
  • Number of attempts: 1
Lisp Condense - 460 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 14
  • Position: #89 / 158
  • Number of attempts: 2
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #408 / 437
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10688 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1593 / 3691
  • Number of attempts: 4
Letter case trickery - 1630 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: 19
  • Position: #495 / 518
  • Number of attempts: 1
Words in parens - 12967 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 23
  • Position: #3685 / 3969
  • Number of attempts: 2
The name of the game - 671 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #275 / 362
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1606 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #252 / 446
  • Number of attempts: 3
Let's play some Ivmgolf - 1122 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #335 / 446
  • Number of attempts: 5
Switch function arguments - 2147 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #330 / 666
  • Number of attempts: 4
switch variable - 5079 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #1006 / 1749
  • Number of attempts: 2
Make it more readable - 2009 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 35
  • Position: #646 / 652
  • Number of attempts: 1
Generate English Alphabets - 487 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 53
  • Position: #193 / 206
  • Number of attempts: 2
Numbering a List - 1935 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 22
  • Position: #452 / 654
  • Number of attempts: 4
The holy-grail may help - 381 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 17
  • Position: #189 / 213
  • Number of attempts: 5
Shebangs for all - 2018 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 25
  • Position: #491 / 519
  • Number of attempts: 3
Jakob Föger
Twitter:

entered into 42 challenges

contributed 0 challenges