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

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

  • Best score: 10
  • Best player score: 11
  • Position: #240 / 502
  • Number of attempts: 6
Python dataclasses - 1120 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 21
  • Position: #118 / 280
  • Number of attempts: 2
RUST Cargo.toml version to last - 325 entries

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

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

Simple challenge for frequent action while programming.

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

Put a cross in the square

  • Best score: 20
  • Best player score: 23
  • Position: #48 / 86
  • Number of attempts: 3
swap number pairs - 2021 entries

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

  • Best score: 16
  • Best player score: 35
  • Position: #288 / 372
  • Number of attempts: 4
HS Final exam vimgolf - 885 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: #59 / 232
  • Number of attempts: 8
Easy modification of ssh config - 343 entries

Just add another alias to each worker

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

LAMBDA!!!

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

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

  • Best score: 9
  • Best player score: 10
  • Position: #412 / 1082
  • Number of attempts: 5
Satisfy the go linter - 2350 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 / 462
  • Number of attempts: 10
Add quotes to ansible playbook - 939 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #147 / 299
  • Number of attempts: 3
Multiline to Single Line - 679 entries

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

  • Best score: 5
  • Best player score: 6
  • Position: #255 / 297
  • Number of attempts: 1
xrandr outputs and dashes - 670 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 / 217
  • Number of attempts: 5
Simple, Practical, and Common - 33420 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: #2329 / 7375
  • Number of attempts: 9
Get mail address from outlook format - 641 entries

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

  • Best score: 15
  • Best player score: 15
  • Position: #62 / 201
  • Number of attempts: 3
Reconstruct the actual output from my unit test tool report - 151 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: #44 / 51
  • Number of attempts: 4
Swap values - 4548 entries

Well, swap the values...

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #706 / 1526
  • Number of attempts: 9
One number per line - 18638 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 34
  • Position: #3711 / 3848
  • Number of attempts: 1
Quote modules (ver.2) - 224 entries

Complete golang import statement.

  • Best score: 22
  • Best player score: 24
  • Position: #31 / 58
  • Number of attempts: 5
citizen_hacks_2019_challenge2 - 190 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #51 / 100
  • Number of attempts: 5
Unsemantic linewrapping - 895 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 / 225
  • Number of attempts: 7
Applying same text modification in several lines - 2851 entries

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

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

Make arrow function type less verbose and easier to read

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

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1697 / 3049
  • Number of attempts: 9
remove lines containing the word "reader" - 3555 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #475 / 1150
  • Number of attempts: 6
Com(m)a Trouble - 3696 entries

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

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

For the Citizen Hacks 2019 Vim competition.

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

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #422 / 1868
  • Number of attempts: 10
Tables, Functions, Sprocs - 125 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 / 44
  • Number of attempts: 5
From argument to object - 1480 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: #256 / 452
  • Number of attempts: 2
Every other line - 2901 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #263 / 702
  • Number of attempts: 6
Copy three lines - 2863 entries

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

  • Best score: 13
  • Best player score: 22
  • Position: #512 / 637
  • Number of attempts: 2
Number Sort - 306 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 / 164
  • Number of attempts: 3
That hyphen - 2560 entries

"vim vi improved"

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

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3153 / 4167
  • Number of attempts: 4
Todo list specification - 385 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: #98 / 176
  • Number of attempts: 1
Remember VimGolf Rules ! - 259 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #120 / 139
  • Number of attempts: 3
Stairstep digits - 381 entries

Remove the evens. Double the odds.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #253 / 1258
  • Number of attempts: 12
Simple addition - 310 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 / 117
  • Number of attempts: 8
Add to end of each line... kinda - 327 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 / 172
  • Number of attempts: 4
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: 9
  • Position: #78 / 139
  • Number of attempts: 5
replace 2nd column blanks with values in same column if blank - 231 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 / 81
  • Number of attempts: 7
Vice versa - 7813 entries

Little role switching.

  • Best score: 12
  • Best player score: 23
  • Position: #1946 / 2106
  • Number of attempts: 5
Free hyphen! - 162 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 / 87
  • Number of attempts: 3
Paragraph sort - 430 entries

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

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

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #134 / 257
  • Number of attempts: 5
Paragraph breaks - 509 entries

Swap the blank lines and the aaa lines.

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

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #291 / 420
  • Number of attempts: 5
Inner hyphens - 127 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 / 79
  • Number of attempts: 3
ascii-art diamond - 35 entries

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

  • Best score: 40
  • Best player score: 46
  • Position: #11 / 15
  • Number of attempts: 1
Hello ${world} - 299 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

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

For the Citizen Hacks 2019 Vim competition.

  • Best score: 5
  • Best player score: 5
  • Position: #37 / 62
  • Number of attempts: 2
Change part of a function name in multiple occurrences - 644 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 / 204
  • Number of attempts: 4
citizen_hacks_2019_challenge5 - 138 entries

For the Citizen Hacks 2019 Vim competition.

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

This shouldn't be too tough

  • Best score: 4
  • Best player score: 6
  • Position: #143 / 150
  • Number of attempts: 5
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: 5
  • Position: #242 / 387
  • Number of attempts: 4
Song Transcription Oops - 234 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 / 75
  • Number of attempts: 4
change parenthesis - 286 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 10
  • Position: #138 / 159
  • Number of attempts: 2
Remove quotes after first field - 358 entries

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

  • Best score: 16
  • Best player score: 18
  • Position: #39 / 88
  • Number of attempts: 10
Restore order to the alphabet - 196 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 44
  • Position: #67 / 70
  • Number of attempts: 1
Mirror Symmetry - 811 entries

Add backslashes.

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

I want change 5 words

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

Convert to comma separated list.

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

Based on "The name of the game".

  • Best score: 12
  • Best player score: 15
  • Position: #305 / 343
  • Number of attempts: 3
Space out the alphabet - 1629 entries

Put 3 spaces between adjacent letters.

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

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #139 / 237
  • Number of attempts: 4
Condensed Cases - 793 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: #234 / 243
  • Number of attempts: 2
Happy TvvO - 417 entries

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

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

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1233 / 4163
  • Number of attempts: 7
learn vim in short time - 232 entries

so happy to learn vim.because vim is awesome

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

Reduce 4 cons selection operations down to one function call.

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

Rotate that triangle.

  • Best score: 14
  • Best player score: 16
  • Position: #45 / 143
  • Number of attempts: 10
A HAPPY NEW YEAR 2014 ! - 10637 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1575 / 3671
  • Number of attempts: 2
Words in parens - 12863 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1151 / 3948
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 6660 entries

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

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

반갑습니다.

entered into 78 challenges

contributed 0 challenges