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

Surround the 'z' character with brackets, quotes, and print as formatted string. - 494 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #13 / 278
  • Number of attempts: 1
Easier Align - 357 entries

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 67
  • Position: #20 / 92
  • Number of attempts: 5
Paste a column after a column - 2324 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 14
  • Position: #33 / 502
  • Number of attempts: 11
Filter number combinations that don't add to 11 - 378 entries

Append the sum of each line to its end, alongside an equals sign, and remove any that do not sum to 11. The ordering of lines should stay the same. Note that the combinations are semi-arbitrary and not all 4-number combinations are present in the file.

  • Best score: 27
  • Best player score: 28
  • Position: #55 / 112
  • Number of attempts: 5
Tabbed Table to Python Array - 645 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 59
  • Position: #70 / 167
  • Number of attempts: 2
HS exam question - 1517 entries

Convert the data to a python dictionary

  • Best score: 12
  • Best player score: 59
  • Position: #112 / 400
  • Number of attempts: 6
Substraction (bis) - 579 entries

Solve the equations (adapted from the original @Caek_'s challenge).

  • Best score: 21
  • Best player score: 32
  • Position: #62 / 108
  • Number of attempts: 6
Changing around text with citations - 323 entries

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 43
  • Position: #63 / 89
  • Number of attempts: 3
Poorly indented Python comments - 1217 entries

Fix the alignment of some Python comments as quickly as possible.

  • Best score: 15
  • Best player score: 16
  • Position: #51 / 206
  • Number of attempts: 9
Many duplicates - 1284 entries

Quick and easy

  • Best score: 7
  • Best player score: 10
  • Position: #331 / 421
  • Number of attempts: 1
2 quick changes and a numbered list - 610 entries

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

  • Best score: 37
  • Best player score: 43
  • Position: #67 / 146
  • Number of attempts: 2
delete swap - 1578 entries

delete all swap

  • Best score: 5
  • Best player score: 6
  • Position: #367 / 495
  • Number of attempts: 2
Generate a very basic Python constructor (fixed) - 1197 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 43
  • Position: #126 / 252
  • Number of attempts: 6
Fix the shell script! - 2373 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 29
  • Position: #206 / 550
  • Number of attempts: 5
Visual block training - 1028 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 38
  • Position: #107 / 191
  • Number of attempts: 1
Put a newline after every 10 lines in vim - 1606 entries

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

  • Best score: 10
  • Best player score: 12
  • Position: #232 / 535
  • Number of attempts: 3
Java to JavaScript - 261 entries

Let convert some simple Java file to JavaScript!

  • Best score: 59
  • Best player score: 89
  • Position: #39 / 68
  • Number of attempts: 1
Wikitext headings to markdown - 983 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 25
  • Position: #110 / 205
  • Number of attempts: 1
hello-world-vimgolf - 2402 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #261 / 681
  • Number of attempts: 2
Contribute to keyboard mashing - 861 entries

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #196 / 262
  • Number of attempts: 2
Plotting some variables in python - 1597 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 40
  • Position: #123 / 342
  • Number of attempts: 2
Lowercase first characters - 480 entries

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

  • Best score: 33
  • Best player score: 35
  • Position: #62 / 178
  • Number of attempts: 1
RUST match with enum for Coin - 180 entries

RUST match with enum for Coin rusty practice on vimgolf

  • Best score: 84
  • Best player score: 91
  • Position: #11 / 51
  • Number of attempts: 8
Making 3 line function a one liner. - 311 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #134 / 199
  • Number of attempts: 1
Modernise code - 1350 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 41
  • Position: #134 / 311
  • Number of attempts: 1
Enumerate Bullets - 308 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

  • Best score: 20
  • Best player score: 20
  • Position: #22 / 83
  • Number of attempts: 4
swap number pairs - 2021 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #160 / 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: 40
  • Position: #190 / 232
  • Number of attempts: 1
Easy modification of ssh config - 343 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 26
  • Position: #48 / 106
  • Number of attempts: 4
Python: Def to Lambda - 435 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 24
  • Position: #138 / 152
  • Number of attempts: 1
Rural Post - 4405 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #192 / 1082
  • Number of attempts: 8
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: 29
  • Position: #356 / 462
  • Number of attempts: 3
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: #193 / 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: 5
  • Position: #224 / 297
  • Number of attempts: 1
Capitalize the Names - 381 entries

I want to capitalize the names in quotes, but just the people's names, not the file names.

  • Best score: 21
  • Best player score: 34
  • Position: #74 / 94
  • Number of attempts: 2
Yo To Hello - 1122 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #379 / 520
  • Number of attempts: 3
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: 28
  • Position: #4506 / 7375
  • Number of attempts: 4
Hogwarts Email Sorting - 890 entries

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

  • Best score: 20
  • Best player score: 26
  • Position: #209 / 256
  • Number of attempts: 2
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: 19
  • Position: #40 / 51
  • Number of attempts: 3
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: 10
  • Position: #429 / 1526
  • Number of attempts: 6
One number per line - 18638 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2572 / 3848
  • Number of attempts: 2
Right Align Part of the line - 132 entries

The challenge is to right align a part of the line - this is useful in some SQL queries where it's more clear which are the fields displayed

  • Best score: 19
  • Best player score: 20
  • Position: #21 / 42
  • Number of attempts: 5
Quote modules - 1063 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #205 / 277
  • Number of attempts: 1
Swap values inside brackets - 2465 entries

Easy challenge.

  • Best score: 14
  • Best player score: 25
  • Position: #506 / 570
  • Number of attempts: 1
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: 17
  • Position: #649 / 843
  • Number of attempts: 1
Add semicolons - 10806 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 12
  • Position: #1940 / 3049
  • Number of attempts: 3
Bad Copy Syntax - 2005 entries

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

  • Best score: 18
  • Best player score: 38
  • Position: #477 / 517
  • Number of attempts: 2
remove lines containing the word "reader" - 3555 entries

easy stuff

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

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

  • Best score: 12
  • Best player score: 49
  • Position: #802 / 833
  • Number of attempts: 1
Box it - 7836 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 25
  • Position: #1040 / 1868
  • Number of attempts: 2
Cool or not? - 802 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 22
  • Position: #185 / 228
  • Number of attempts: 1
Two pairs of cluster of letters creates word - 741 entries

Clean and group.

  • Best score: 17
  • Best player score: 40
  • Position: #161 / 175
  • Number of attempts: 1
Extract argument from function - 2318 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 14
  • Position: #386 / 746
  • Number of attempts: 2
Preferably without multi-cursor plugin - 538 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 35
  • Position: #67 / 127
  • Number of attempts: 1
Flip the bit - 123 entries

Change the specific 0 to a 1.

  • Best score: 8
  • Best player score: 9
  • Position: #42 / 72
  • Number of attempts: 2
Just the middle - 11369 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3183 / 4167
  • Number of attempts: 2
Python Hello World! Reformatting - 939 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 40
  • Position: #36 / 365
  • Number of attempts: 5
Basic renumbering - 5591 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #268 / 1258
  • Number of attempts: 2
Vice versa - 7813 entries

Little role switching.

  • Best score: 12
  • Best player score: 20
  • Position: #1867 / 2106
  • Number of attempts: 2
One to Ten - 2174 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: 12
  • Position: #352 / 664
  • Number of attempts: 1
Line under headers - 2022 entries

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

  • Best score: 24
  • Best player score: 36
  • Position: #395 / 498
  • Number of attempts: 1
Increment each number - 994 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 22
  • Position: #189 / 244
  • Number of attempts: 1
simple format (3) - 73 entries

reverse two column values!

  • Best score: 34
  • Best player score: 36
  • Position: #12 / 22
  • Number of attempts: 2
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: #250 / 387
  • Number of attempts: 1
move titles next to url, in quotes - 504 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 46
  • Position: #131 / 135
  • Number of attempts: 1
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: 14
  • Position: #147 / 243
  • Number of attempts: 2
Pretty format for variable declarations - 155 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 13
  • Best player score: 21
  • Position: #53 / 62
  • Number of attempts: 1
I forgot quotes - 15935 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #1129 / 4163
  • Number of attempts: 6
Two become one - 712 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 28
  • Position: #71 / 207
  • Number of attempts: 4
Where should I put the Newline? - 865 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #407 / 432
  • Number of attempts: 1
Piphilology - 142 entries

Piphilology comprises the creation and use of mnemonic techniques to remember a span of digits of the mathematical constant π. http://en.wikipedia.org/wiki/Piphilology

  • Best score: 29
  • Best player score: 35
  • Position: #21 / 52
  • Number of attempts: 6
Mess in revision history - 1179 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 24
  • Position: #143 / 248
  • Number of attempts: 6
HTML formatting: vertical alignment for readability - 63 entries

We did this a VimGolf challenge at work and now that we have finished I want to see if you guys can come up with something even better than we could. Our best solution was 44 keystrokes.

  • Best score: 33
  • Best player score: 36
  • Position: #13 / 33
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10637 entries

A HAPPY NEW YEAR 2014 !

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

We should all ace this, right?

  • Best score: 13
  • Best player score: 21
  • Position: #3501 / 3948
  • Number of attempts: 1
paste indent correction - JS - 102 entries

You copy some javascript code from a website and paste it into vim, it does not look good!

  • Best score: 16
  • Best player score: 16
  • Position: #41 / 57
  • Number of attempts: 2
Execute immediate SQL - 85 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 72
  • Position: #17 / 30
  • Number of attempts: 1
Transposition - 82 entries

Transpose the original lines in separate columns, one for each line.

  • Best score: 31
  • Best player score: 36
  • Position: #8 / 30
  • Number of attempts: 3
Groups magic - 157 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • Position: #70 / 92
  • Number of attempts: 1
Sort by your own sum - 71 entries

Same numbers as last time, but you'll have to add them yourself.

  • Best score: 25
  • Best player score: 26
  • Position: #6 / 28
  • Number of attempts: 7
Circle of Fifths with Sharps - 96 entries

Display a list of the Circle of Fifths with corresponding solfege syllables with sharps. Handling spaces may be tricky.

  • Best score: 24
  • Best player score: 29
  • Position: #22 / 36
  • Number of attempts: 1
Checkerboard case pattern - 148 entries

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

  • Best score: 15
  • Best player score: 15
  • Position: #4 / 58
  • Number of attempts: 5
Add links to an existing HTML table - 77 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

  • Best score: 42
  • Best player score: 53
  • Position: #15 / 29
  • Number of attempts: 1
Tiny column alignment - 47 entries

Align using the four blocks, don't forget to lowercase and have fun!

  • Best score: 33
  • Best player score: 45
  • Position: #13 / 22
  • Number of attempts: 2
maximun and minimun - 58 entries

Find the maximum and minimum of the rows.

  • Best score: 51
  • Best player score: 69
  • Position: #18 / 24
  • Number of attempts: 3
Enharmonic Equivalents - 56 entries

Transform # and b to digraphs

  • Best score: 18
  • Best player score: 19
  • Position: #27 / 35
  • Number of attempts: 1
The holy-grail may help - 352 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #156 / 207
  • Number of attempts: 2
CSV to JSON - 172 entries

A search for shortest vimissh way to convert CSV to JSON.

  • Best score: 56
  • Best player score: 88
  • Position: #23 / 65
  • Number of attempts: 1
Shebangs for all - 1916 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 16
  • Position: #322 / 501
  • Number of attempts: 2
Increment, increment, increment.... - 665 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #58 / 402
  • Number of attempts: 2
The Cake is a Lie - 1293 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #453 / 514
  • Number of attempts: 1
Simple text editing with Vim - 12360 entries

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

  • Best score: 13
  • Best player score: 21
  • Position: #2838 / 3599
  • Number of attempts: 1
Иван
Twitter:

entered into 92 challenges

contributed 0 challenges