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

Many duplicates - 1333 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #165 / 436
  • Number of attempts: 2
2 quick changes and a numbered list - 614 entries

The ascii will not be lost, but rather numbered in 4 digit blocks with leading zeros.

  • Best score: 37
  • Best player score: 59
  • Position: #105 / 147
  • Number of attempts: 2
Put a newline after every 10 lines in vim - 1646 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #370 / 548
  • Number of attempts: 1
hello-world-vimgolf - 2472 entries

Simple number generation

  • Best score: 10
  • Best player score: 13
  • Position: #483 / 699
  • Number of attempts: 2
Contribute to keyboard mashing - 878 entries

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #193 / 267
  • Number of attempts: 1
Inverting Lines - 1870 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 13
  • Position: #337 / 505
  • Number of attempts: 1
swap number pairs - 2022 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 22
  • Position: #158 / 373
  • Number of attempts: 1
Python: Def to Lambda - 441 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 23
  • Position: #130 / 154
  • Number of attempts: 1
Yo To Hello - 1127 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #372 / 522
  • Number of attempts: 3
V to the i - 4770 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1483 / 1887
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 704 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #277 / 397
  • Number of attempts: 1
comment and uncomment code inline - 1074 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 12
  • Position: #264 / 316
  • Number of attempts: 1
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3179 / 4174
  • Number of attempts: 2
For all cases. - 145 entries

In this case... change it! :) Watch the line.

  • Best score: 8
  • Best player score: 8
  • Position: #82 / 102
  • Number of attempts: 1
create arrows in a list - 106 entries

Add arrow at same distance

  • Best score: 10
  • Best player score: 10
  • Position: #59 / 71
  • Number of attempts: 2
Adam's challenge - 958 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 23
  • Position: #222 / 267
  • Number of attempts: 1
Add to end of each line... kinda - 328 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: 13
  • Position: #155 / 173
  • Number of attempts: 1
Combines all items - 307 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 10
  • Position: #127 / 139
  • Number of attempts: 1
Fun With The Diagonal - 104 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #74 / 80
  • Number of attempts: 1
Vice versa - 7864 entries

Little role switching.

  • Best score: 12
  • Best player score: 15
  • Position: #1114 / 2114
  • Number of attempts: 2
Free hyphen! - 164 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 11
  • Position: #83 / 88
  • Number of attempts: 1
comments galore - 1017 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #298 / 421
  • Number of attempts: 1
A grid of punctuation - 125 entries

Create a checkerboard of = and - in an 80×24 grid!

  • Best score: 16
  • Best player score: 19
  • Position: #45 / 58
  • Number of attempts: 2
ASCII Art - 85 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 14
  • Position: #40 / 53
  • Number of attempts: 1
Delete to the end of the current line - 794 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 6
  • Position: #341 / 387
  • Number of attempts: 1
VimGolfNight - 538 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #284 / 344
  • Number of attempts: 1
camel riding - 775 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 17
  • Position: #196 / 277
  • Number of attempts: 2
Condensed Cases - 794 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: 15
  • Position: #174 / 244
  • Number of attempts: 1
-a-b-c- - 3183 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #872 / 1132
  • Number of attempts: 1
Change name of a variable - 173 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: #124 / 136
  • Number of attempts: 1
120 Degrees - 469 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 21
  • Position: #93 / 144
  • Number of attempts: 2
Where should I put the Newline? - 871 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #406 / 435
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2502 / 3677
  • Number of attempts: 1
Untangle my tail, please! - 58 entries

You know, this words were playing to chase their tails and Oops! What happened? Now we have a complete mess, their tails are totally tangled, can you please help them to untangle their tails?

  • Best score: 16
  • Best player score: 17
  • Position: #22 / 32
  • Number of attempts: 3
Delete unwanted lines - 398 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #191 / 227
  • Number of attempts: 1
Word frequency alignment - 278 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 5
  • Position: #115 / 159
  • Number of attempts: 2
Block Fun 1 - 190 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 24
  • Position: #58 / 74
  • Number of attempts: 1
abcd > a b c d - 282 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #194 / 220
  • Number of attempts: 1
A simple change - 444 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #130 / 190
  • Number of attempts: 3
Unwrap the text of an email message - 188 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 16
  • Position: #33 / 73
  • Number of attempts: 4
Let's play some Ivmgolf - 1096 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #135 / 442
  • Number of attempts: 2
Append semicolon after expressions - 1023 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #136 / 410
  • Number of attempts: 3
A Simple One - 1009 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #555 / 648
  • Number of attempts: 1
82 bottles of beer on the wall - 307 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

  • Best score: 106
  • Best player score: 124
  • Position: #53 / 143
  • Number of attempts: 2
Dumb to smart - 97 entries

Turn dumb quote to smart vim's way.

  • Best score: 28
  • Best player score: 33
  • Position: #31 / 55
  • Number of attempts: 1
Context insensitive completion 0 - 545 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Position: #118 / 239
  • Number of attempts: 3
Almost encrypted - 199 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Position: #122 / 145
  • Number of attempts: 1
James Marshall
Twitter:

Astronomer working with Earth science data systems at GSFC. Posts are my own; I am *not* an official representative of NASA, etc. Personal-type posts @Dronak

entered into 47 challenges

contributed 0 challenges