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

Satisfy the go linter - 2169 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 21
  • Position: #158 / 434
  • Number of attempts: 5
Add quotes to ansible playbook - 872 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #109 / 274
  • Number of attempts: 2
Simple, Practical, and Common - 33354 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: 28
  • Position: #4440 / 7358
  • Number of attempts: 3
Hogwarts Email Sorting - 875 entries

Given a list of emails, get the students full name and their associated house.

  • Best score: 20
  • Best player score: 31
  • Position: #218 / 253
  • Number of attempts: 2
prepend * to every non-blank line - 6202 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #448 / 1514
  • Number of attempts: 2
One number per line - 18615 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 24
  • Position: #3237 / 3841
  • Number of attempts: 1
Quote modules - 1046 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 27
  • Position: #158 / 272
  • Number of attempts: 2
Unsemantic linewrapping - 890 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

  • Best score: 9
  • Best player score: 17
  • Position: #212 / 224
  • Number of attempts: 1
V to the i - 4743 entries

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

  • Best score: 7
  • Best player score: 9
  • Position: #1716 / 1878
  • Number of attempts: 1
Add semicolons - 10785 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1295 / 3042
  • Number of attempts: 2
Bad Copy Syntax - 1999 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 31
  • Position: #432 / 514
  • Number of attempts: 2
remove lines containing the word "reader" - 3528 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Position: #1028 / 1142
  • Number of attempts: 1
Com(m)a Trouble - 3654 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #476 / 821
  • Number of attempts: 1
citizen_hacks_2019_challenge3 - 35 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 4
  • Best player score: 4
  • Position: #18 / 32
  • Number of attempts: 1
Box it - 7818 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 32
  • Position: #1488 / 1861
  • Number of attempts: 2
Just the middle - 11346 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 10
  • Position: #3824 / 4160
  • Number of attempts: 1
Make HTML List - 1039 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 50
  • Position: #211 / 271
  • Number of attempts: 1
Remember VimGolf Rules ! - 257 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #112 / 138
  • Number of attempts: 2
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 63 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: #23 / 37
  • Number of attempts: 1
Replace and keep the case - 407 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 27
  • Position: #61 / 115
  • Number of attempts: 7
One to Ten - 2159 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: 15
  • Position: #524 / 660
  • Number of attempts: 1
Line under headers - 1996 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 42
  • Position: #445 / 494
  • Number of attempts: 1
ASCII Art - 82 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 11
  • Position: #33 / 52
  • Number of attempts: 1
Delete to the end of the current line - 738 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #204 / 363
  • Number of attempts: 1
Assign numbers to fields - 105 entries

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

  • Best score: 19
  • Best player score: 30
  • Position: #56 / 59
  • Number of attempts: 1
From A to B - 564 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 20
  • Position: #115 / 155
  • Number of attempts: 2
Remove hard line breaks - 67 entries

Text files with Hard breaks are not good for e-readers. We need remove all hard line breaks and have long lines.

  • Best score: 10
  • Best player score: 23
  • Position: #28 / 32
  • Number of attempts: 1
Greek column realign - 48 entries

Oops one letter is missing! Shift down the second column to insert nu letter. Symbol can be entered using: <C-K>n*

  • Best score: 21
  • Best player score: 40
  • Position: #23 / 24
  • Number of attempts: 1
Roman numerals - 68 entries

Use the substitutions on top to convert unary to Roman numerals.

  • Best score: 17
  • Best player score: 52
  • Position: #26 / 27
  • Number of attempts: 1
Words in parens - 12850 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2720 / 3944
  • Number of attempts: 1
Delete unwanted lines - 396 entries

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

  • Best score: 9
  • Best player score: 12
  • Position: #218 / 225
  • Number of attempts: 1
Checkerboard case pattern - 144 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 25
  • Position: #51 / 57
  • Number of attempts: 1
Presidential Sorting - 47 entries

Given a nice CSV formatted arrangement of the Presidents of the United States, we need to print out an alphabetical list in pretty columns. Prove that vim can conquer this basic Excel task!

  • Best score: 40
  • Best player score: 66
  • Position: #22 / 22
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 400 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 11
  • Position: #151 / 187
  • Number of attempts: 1
Generate English Alphabets - 463 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Position: #67 / 198
  • Number of attempts: 1
Indentation - 497 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 21
  • Best player score: 25
  • Position: #52 / 168
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3290 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 31
  • Position: #511 / 729
  • Number of attempts: 1
Flodder-challenge - 1086 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 36
  • Position: #159 / 305
  • Number of attempts: 3
Simple text editing with Vim - 12233 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #1023 / 3567
  • Number of attempts: 5
Reformat/Refactor a Golfer Class - 6512 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 46
  • Position: #1143 / 1603
  • Number of attempts: 1
Bitt Faulk
Twitter:

entered into 40 challenges

contributed 0 challenges