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

Inverting Lines - 1011 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #131 / 275
  • Number of attempts: 6
Python dataclasses - 424 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 21
  • Position: #51 / 120
  • Number of attempts: 2
RUST Cargo.toml version to last - 190 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

  • Best score: 16
  • Best player score: 17
  • Position: #24 / 59
  • Number of attempts: 5
Making 3 line function a one liner. - 94 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #17 / 68
  • Number of attempts: 1
Put a cross in the square - 91 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 23
  • Position: #31 / 42
  • Number of attempts: 3
swap number pairs - 1294 entries

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

  • Best score: 16
  • Best player score: 35
  • Position: #185 / 244
  • Number of attempts: 4
HS Final exam vimgolf - 578 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #44 / 156
  • Number of attempts: 8
Easy modification of ssh config - 165 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 43
  • Position: #43 / 49
  • Number of attempts: 1
Python: Def to Lambda - 221 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #31 / 80
  • Number of attempts: 3
Rural Post - 3800 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #378 / 939
  • Number of attempts: 5
Satisfy the go linter - 1625 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: 20
  • Position: #98 / 334
  • Number of attempts: 10
Add quotes to ansible playbook - 597 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #107 / 190
  • Number of attempts: 3
Multiline to Single Line - 378 entries

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

  • Best score: 5
  • Best player score: 6
  • Position: #161 / 179
  • Number of attempts: 1
xrandr outputs and dashes - 568 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: 12
  • Position: #106 / 184
  • Number of attempts: 5
Simple, Practical, and Common - 32778 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: #2330 / 7242
  • Number of attempts: 9
Get mail address from outlook format - 560 entries

Create a mail list space separated of mail list formatted by outlook

  • Best score: 15
  • Best player score: 15
  • Position: #62 / 173
  • Number of attempts: 3
Reconstruct the actual output from my unit test tool report - 125 entries

When a test fails, my unit test tool reports differences between the actual output and the expected output as follow: - line in the expected output but missing in the actual output are prefixed with a dash - unexpected lines in the actual output are prefixed with a plus sign - comments added by the unit test tool are prefixed with a question mark - common lines are showed `as-is` (well, almost;) From that "diff" format, I would like to reconstruct the actual output.

  • Best score: 16
  • Best player score: 20
  • Position: #36 / 42
  • Number of attempts: 4
Swap values - 4409 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #347 / 1235
  • Number of attempts: 8
prepend * to every non-blank line - 5829 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #671 / 1434
  • Number of attempts: 9
One number per line - 18295 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 34
  • Position: #3639 / 3770
  • Number of attempts: 1
Quote modules (ver.2) - 185 entries

Complete golang import statement.

  • Best score: 22
  • Best player score: 24
  • Position: #26 / 48
  • Number of attempts: 5
citizen_hacks_2019_challenge2 - 165 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #51 / 83
  • Number of attempts: 5
Unsemantic linewrapping - 821 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: 9
  • Position: #90 / 205
  • Number of attempts: 7
Applying same text modification in several lines - 2713 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #3 / 807
  • Number of attempts: 5
Refactor typescript arrow function type - 278 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 20
  • Position: #21 / 62
  • Number of attempts: 10
Add semicolons - 10467 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1665 / 2966
  • Number of attempts: 9
remove lines containing the word "reader" - 3436 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #476 / 1113
  • Number of attempts: 6
Com(m)a Trouble - 3308 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #143 / 746
  • Number of attempts: 9
citizen_hacks_2019_challenge3 - 24 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 4
  • Best player score: 4
  • Position: #20 / 22
  • Number of attempts: 1
Box it - 7661 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #423 / 1830
  • Number of attempts: 10
Tables, Functions, Sprocs - 109 entries

In order to load some scripts into my database in the correct order I need to load tables first (t_), then functions (fn_), then stored procedures (sp_). The order of the t_ lines and the order of the sp_ lines should also match. Reorder the lines so they will load correctly.

  • Best score: 10
  • Best player score: 10
  • Position: #17 / 37
  • Number of attempts: 5
From argument to object - 1258 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 18
  • Position: #233 / 416
  • Number of attempts: 2
Every other line - 2790 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #257 / 679
  • Number of attempts: 6
Copy three lines - 2767 entries

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

  • Best score: 13
  • Best player score: 22
  • Position: #498 / 620
  • Number of attempts: 2
Number Sort - 283 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: #122 / 151
  • Number of attempts: 3
That hyphen - 2472 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #234 / 676
  • Number of attempts: 7
Just the middle - 11086 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3121 / 4093
  • Number of attempts: 4
Todo list specification - 359 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 38
  • Position: #91 / 164
  • Number of attempts: 1
Remember VimGolf Rules ! - 225 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #114 / 123
  • Number of attempts: 3
Stairstep digits - 238 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 9
  • Position: #44 / 113
  • Number of attempts: 4
Basic renumbering - 5408 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #253 / 1221
  • Number of attempts: 12
Simple addition - 288 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 12
  • Position: #52 / 105
  • Number of attempts: 8
Add to end of each line... kinda - 285 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: #98 / 153
  • Number of attempts: 4
Combines all items - 265 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #78 / 121
  • Number of attempts: 5
replace 2nd column blanks with values in same column if blank - 209 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

  • Best score: 15
  • Best player score: 15
  • Position: #27 / 72
  • Number of attempts: 7
Vice versa - 7462 entries

Little role switching.

  • Best score: 12
  • Best player score: 23
  • Position: #1880 / 2023
  • Number of attempts: 5
Free hyphen! - 144 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: 9
  • Position: #29 / 79
  • Number of attempts: 3
Paragraph sort - 397 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 14
  • Position: #40 / 115
  • Number of attempts: 12
Order and join - 858 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #125 / 236
  • Number of attempts: 5
Paragraph breaks - 477 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 10
  • Position: #42 / 158
  • Number of attempts: 6
comments galore - 965 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #291 / 408
  • Number of attempts: 5
Inner hyphens - 121 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

  • Best score: 11
  • Best player score: 11
  • Position: #11 / 75
  • Number of attempts: 3
ascii-art diamond - 34 entries

Simple ascii-art diamond. The grid is 40x40.

  • Best score: 40
  • Best player score: 46
  • Position: #10 / 14
  • Number of attempts: 1
Hello ${world} - 291 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

  • Best score: 24
  • Best player score: 24
  • Position: #30 / 90
  • Number of attempts: 1
citizen_hacks_2019_challenge4 - 70 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 5
  • Best player score: 5
  • Position: #37 / 49
  • Number of attempts: 2
Change part of a function name in multiple occurrences - 595 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

  • Best score: 14
  • Best player score: 14
  • Position: #62 / 190
  • Number of attempts: 4
citizen_hacks_2019_challenge5 - 113 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #34 / 59
  • Number of attempts: 3
Join 'em - 217 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 6
  • Position: #121 / 127
  • Number of attempts: 5
Delete to the end of the current line - 711 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #242 / 348
  • Number of attempts: 4
Song Transcription Oops - 222 entries

When transcribing vocal music to Canjo Tab you can start by finding the lowest note and assigning that to zero and working your way up from there. However, without fail, I tend to miscount the notes and when I am near done I find a lower note. I mark this with a "z". This means I have to increase all the previous ones by 1. just a sting of numbers :)

  • Best score: 15
  • Best player score: 15
  • Position: #50 / 68
  • Number of attempts: 4
change parenthesis - 238 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 10
  • Position: #125 / 135
  • Number of attempts: 2
Remove quotes after first field - 315 entries

Remove the quotes around each field except for the first field.

  • Best score: 16
  • Best player score: 18
  • Position: #34 / 78
  • Number of attempts: 10
Restore order to the alphabet - 162 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 44
  • Position: #58 / 61
  • Number of attempts: 1
Mirror Symmetry - 752 entries

Add backslashes.

  • Best score: 7
  • Best player score: 7
  • Position: #88 / 257
  • Number of attempts: 7
unknown command - 143 entries

I want change 5 words

  • Best score: 7
  • Best player score: 7
  • Position: #56 / 72
  • Number of attempts: 4
Collect List - 4155 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #512 / 1161
  • Number of attempts: 7
VimGolfNight - 482 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 15
  • Position: #287 / 322
  • Number of attempts: 3
Space out the alphabet - 1563 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Position: #106 / 427
  • Number of attempts: 11
Mute the second method of this script - 430 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #139 / 229
  • Number of attempts: 4
Condensed Cases - 735 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: 28
  • Position: #218 / 226
  • Number of attempts: 2
Happy TvvO - 379 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #144 / 190
  • Number of attempts: 4
I forgot quotes - 15668 entries

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1217 / 4099
  • Number of attempts: 7
learn vim in short time - 212 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #119 / 144
  • Number of attempts: 2
Lisp Condense - 421 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 13
  • Position: #55 / 148
  • Number of attempts: 8
120 Degrees - 416 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 16
  • Position: #40 / 137
  • Number of attempts: 10
A HAPPY NEW YEAR 2014 ! - 10515 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1576 / 3630
  • Number of attempts: 2
Words in parens - 12690 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1141 / 3906
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5869 entries

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

  • Best score: 32
  • Best player score: 54
  • Position: #1305 / 1451
  • Number of attempts: 2
김범준
Twitter:

반갑습니다.

entered into 78 challenges

contributed 0 challenges