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 - 1252 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #161 / 411
  • Number of attempts: 2
2 quick changes and a numbered list - 599 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: #103 / 145
  • Number of attempts: 2
Put a newline after every 10 lines in vim - 1577 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #360 / 524
  • Number of attempts: 1
hello-world-vimgolf - 2346 entries

Simple number generation

  • Best score: 10
  • Best player score: 13
  • Position: #461 / 663
  • Number of attempts: 2
Contribute to keyboard mashing - 839 entries

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #186 / 256
  • Number of attempts: 1
Inverting Lines - 1832 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #330 / 497
  • Number of attempts: 1
swap number pairs - 2011 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #157 / 370
  • Number of attempts: 1
Python: Def to Lambda - 423 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 23
  • Position: #126 / 149
  • Number of attempts: 1
Yo To Hello - 1114 entries

Simply Turn Yo To Hello

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

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

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

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

  • Best score: 5
  • Best player score: 5
  • Position: #277 / 386
  • Number of attempts: 1
comment and uncomment code inline - 1069 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: #263 / 314
  • Number of attempts: 1
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3177 / 4164
  • Number of attempts: 2
For all cases. - 141 entries

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

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

Add arrow at same distance

  • Best score: 10
  • Best player score: 10
  • Position: #59 / 70
  • Number of attempts: 2
Adam's challenge - 957 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: #221 / 266
  • Number of attempts: 1
Add to end of each line... kinda - 325 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: #154 / 171
  • Number of attempts: 1
Combines all items - 303 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #125 / 137
  • Number of attempts: 1
Fun With The Diagonal - 103 entries

change the lowercase characters on the main diagonal to uppercase

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

Little role switching.

  • Best score: 12
  • Best player score: 15
  • Position: #1111 / 2100
  • Number of attempts: 2
Free hyphen! - 159 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 / 85
  • Number of attempts: 1
comments galore - 998 entries

Basic comment reformatting

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

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

  • Best score: 16
  • Best player score: 19
  • Position: #44 / 57
  • Number of attempts: 2
ASCII Art - 82 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 14
  • Position: #39 / 52
  • Number of attempts: 1
Delete to the end of the current line - 784 entries

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

  • Best score: 5
  • Best player score: 6
  • Position: #339 / 384
  • Number of attempts: 1
VimGolfNight - 536 entries

Based on "The name of the game".

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

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 17
  • Position: #194 / 274
  • Number of attempts: 2
Condensed Cases - 788 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: #172 / 242
  • Number of attempts: 1
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #870 / 1129
  • Number of attempts: 1
Change name of a variable - 169 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 / 132
  • Number of attempts: 1
120 Degrees - 468 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 21
  • Position: #92 / 143
  • Number of attempts: 2
Where should I put the Newline? - 863 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #404 / 431
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2497 / 3666
  • Number of attempts: 1
Untangle my tail, please! - 57 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: #21 / 31
  • Number of attempts: 3
Delete unwanted lines - 396 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #191 / 225
  • Number of attempts: 1
Word frequency alignment - 273 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 / 156
  • Number of attempts: 2
Block Fun 1 - 189 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 24
  • Position: #57 / 73
  • Number of attempts: 1
abcd > a b c d - 280 entries

transform the single spaces into 4 spaces repeat for each line

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

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

  • Best score: 12
  • Best player score: 14
  • Position: #129 / 189
  • Number of attempts: 3
Unwrap the text of an email message - 185 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 / 72
  • Number of attempts: 4
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

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

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #136 / 403
  • Number of attempts: 3
A Simple One - 1001 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 / 643
  • Number of attempts: 1
82 bottles of beer on the wall - 303 entries

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

  • Best score: 106
  • Best player score: 124
  • Position: #51 / 141
  • Number of attempts: 2
Dumb to smart - 96 entries

Turn dumb quote to smart vim's way.

  • Best score: 28
  • Best player score: 33
  • Position: #30 / 54
  • Number of attempts: 1
Context insensitive completion 0 - 507 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: #116 / 232
  • Number of attempts: 3
Almost encrypted - 198 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Position: #122 / 144
  • 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