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 - 33612 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: #71 / 7416
  • Number of attempts: 8
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #474 / 1268
  • Number of attempts: 6
One number per line - 18722 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 15
  • Position: #785 / 3860
  • Number of attempts: 6
Swap values inside brackets - 2493 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Position: #173 / 578
  • Number of attempts: 4
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #257 / 1893
  • Number of attempts: 2
Applying same text modification in several lines - 2877 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 13
  • Position: #106 / 850
  • Number of attempts: 3
Swap the operands under comparison - 297 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #15 / 101
  • Number of attempts: 5
Add semicolons - 10850 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #875 / 3062
  • Number of attempts: 6
remove lines containing the word "reader" - 3583 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #107 / 1161
  • Number of attempts: 2
Com(m)a Trouble - 3815 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #234 / 864
  • Number of attempts: 4
Box it - 7904 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #562 / 1875
  • Number of attempts: 3
Hash staircase - 56 entries

Can you use a strategy to come up with this pattern?

  • Best score: 21
  • Best player score: 22
  • Position: #21 / 25
  • Number of attempts: 1
Cool or not? - 829 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 25
  • Position: #205 / 230
  • Number of attempts: 1
multiple cursor alternative - 1519 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: 22
  • Position: #231 / 380
  • Number of attempts: 2
Two pairs of cluster of letters creates word - 749 entries

Clean and group.

  • Best score: 17
  • Best player score: 23
  • Position: #128 / 178
  • Number of attempts: 1
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #238 / 703
  • Number of attempts: 8
Copy three lines - 2872 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 13
  • Position: #115 / 640
  • Number of attempts: 7
Convert Application Output to CSV - 203 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 19
  • Position: #40 / 56
  • Number of attempts: 2
Kolakoski sequence -- level 1 - 74 entries

Generate the Kolakoski sequence as described by its first 75 terms.

  • Best score: 22
  • Best player score: 23
  • Position: #3 / 19
  • Number of attempts: 7
Search and Replace 0 - 4978 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #1202 / 1621
  • Number of attempts: 2
Number Sort - 314 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Position: #100 / 166
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 19
  • Position: #671 / 701
  • Number of attempts: 1
Letterbox - 145 entries

Make a box!

  • Best score: 35
  • Best player score: 46
  • Position: #11 / 28
  • Number of attempts: 1
Flip the bit - 130 entries

Change the specific 0 to a 1.

  • Best score: 7
  • Best player score: 8
  • Position: #10 / 74
  • Number of attempts: 1
Just the middle - 11446 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #386 / 4194
  • Number of attempts: 4
Python Hello World! Reformatting - 989 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 43
  • Position: #176 / 379
  • Number of attempts: 2
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #402 / 1264
  • Number of attempts: 8
Add to end of each line... kinda - 333 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Position: #29 / 174
  • Number of attempts: 2
Fun With The Diagonal - 107 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #62 / 81
  • Number of attempts: 1
Vice versa - 7903 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #27 / 2125
  • Number of attempts: 6
Vim's not included features - 240 entries

Filter not included (-) features in a hypothetical installation of vim.

  • Best score: 23
  • Best player score: 26
  • Position: #35 / 65
  • Number of attempts: 4
One to Ten - 2209 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: #40 / 669
  • Number of attempts: 6
Build a six - 294 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 23
  • Position: #67 / 95
  • Number of attempts: 5
Increment each number - 1023 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 15
  • Position: #4 / 248
  • Number of attempts: 2
snowflake fractal - 51 entries

From step 0 to step 3 of a fractal

  • Best score: 26
  • Best player score: 40
  • Position: #15 / 20
  • Number of attempts: 1
move titles next to url, in quotes - 531 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 22
  • Position: #80 / 140
  • Number of attempts: 3
Assign numbers to fields - 116 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 19
  • Position: #10 / 62
  • Number of attempts: 2
unknown command - 167 entries

I want change 5 words

  • Best score: 7
  • Best player score: 7
  • Position: #40 / 87
  • Number of attempts: 1
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #72 / 1190
  • Number of attempts: 1
readability - 327 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Position: #60 / 152
  • Number of attempts: 2
I forgot quotes - 15977 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #242 / 4177
  • Number of attempts: 8
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #117 / 1137
  • Number of attempts: 5
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 17
  • Position: #303 / 354
  • Number of attempts: 2
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #80 / 271
  • Number of attempts: 4
Don't know what this is - 2022 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: 11
  • Position: #47 / 585
  • Number of attempts: 7
A HAPPY NEW YEAR 2014 ! - 10660 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #777 / 3681
  • Number of attempts: 3
Words in parens - 12929 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #589 / 3961
  • Number of attempts: 9
Shebangs for all - 1998 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: 11
  • Position: #34 / 515
  • Number of attempts: 8
Almost encrypted - 204 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Position: #111 / 146
  • Number of attempts: 2

Contributed Challenges

Build a six - 294 entries

Just enjoy building "a" floors...

Two pairs of cluster of letters creates word - 749 entries

Clean and group.

Cool or not? - 829 entries

abc trying to be cool or not...

T A
Twitter:

entered into 49 challenges

contributed 3 challenges