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. - 554 entries

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

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

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 67
  • Position: #21 / 96
  • Number of attempts: 5
Paste a column after a column - 2537 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 / 553
  • Number of attempts: 11
Filter number combinations that don't add to 11 - 408 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: #59 / 117
  • Number of attempts: 5
Tabbed Table to Python Array - 734 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: #78 / 179
  • Number of attempts: 2
HS exam question - 1589 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 59
  • Position: #116 / 417
  • Number of attempts: 6
Substraction (bis) - 603 entries

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

  • Best score: 21
  • Best player score: 32
  • Position: #64 / 113
  • Number of attempts: 6
Changing around text with citations - 329 entries

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 43
  • Position: #65 / 93
  • Number of attempts: 3
Poorly indented Python comments - 1315 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #57 / 221
  • Number of attempts: 9
Many duplicates - 1445 entries

Quick and easy

  • Best score: 7
  • Best player score: 10
  • Position: #368 / 468
  • Number of attempts: 1
2 quick changes and a numbered list - 647 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: #68 / 154
  • Number of attempts: 2
delete swap - 1786 entries

delete all swap

  • Best score: 5
  • Best player score: 6
  • Position: #408 / 555
  • Number of attempts: 2
Generate a very basic Python constructor (fixed) - 1253 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: #130 / 271
  • Number of attempts: 6
Fix the shell script! - 2544 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 29
  • Position: #212 / 589
  • Number of attempts: 5
Visual block training - 1070 entries

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

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

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

  • Best score: 10
  • Best player score: 12
  • Position: #237 / 556
  • Number of attempts: 3
Java to JavaScript - 269 entries

Let convert some simple Java file to JavaScript!

  • Best score: 59
  • Best player score: 89
  • Position: #40 / 74
  • Number of attempts: 1
Wikitext headings to markdown - 987 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 25
  • Position: #111 / 209
  • Number of attempts: 1
hello-world-vimgolf - 2499 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #201 / 270
  • Number of attempts: 2
Plotting some variables in python - 1661 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: #125 / 348
  • Number of attempts: 2
Lowercase first characters - 487 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 / 183
  • Number of attempts: 1
RUST match with enum for Coin - 183 entries

RUST match with enum for Coin rusty practice on vimgolf

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 41
  • Position: #140 / 323
  • Number of attempts: 1
Enumerate Bullets - 323 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 / 87
  • Number of attempts: 4
swap number pairs - 2103 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #163 / 380
  • Number of attempts: 4
HS Final exam vimgolf - 897 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: #194 / 236
  • Number of attempts: 1
Easy modification of ssh config - 371 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 26
  • Position: #51 / 112
  • Number of attempts: 4
Python: Def to Lambda - 455 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 24
  • Position: #140 / 156
  • Number of attempts: 1
Rural Post - 4479 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #192 / 1097
  • Number of attempts: 8
Satisfy the go linter - 2391 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: #364 / 471
  • Number of attempts: 3
Add quotes to ansible playbook - 954 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #194 / 305
  • Number of attempts: 3
Multiline to Single Line - 700 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #224 / 302
  • Number of attempts: 1
Capitalize the Names - 408 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: #77 / 97
  • Number of attempts: 2
Yo To Hello - 1130 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #379 / 524
  • Number of attempts: 3
Simple, Practical, and Common - 33616 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: #4528 / 7420
  • Number of attempts: 4
Hogwarts Email Sorting - 925 entries

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

  • Best score: 20
  • Best player score: 26
  • Position: #214 / 261
  • Number of attempts: 2
Reconstruct the actual output from my unit test tool report - 152 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: #41 / 52
  • Number of attempts: 3
prepend * to every non-blank line - 6308 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #429 / 1537
  • Number of attempts: 6
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2580 / 3864
  • Number of attempts: 2
Right Align Part of the line - 133 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: #22 / 42
  • Number of attempts: 5
Quote modules - 1084 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #208 / 281
  • Number of attempts: 1
Swap values inside brackets - 2496 entries

Easy challenge.

  • Best score: 14
  • Best player score: 25
  • Position: #513 / 579
  • Number of attempts: 1
Applying same text modification in several lines - 2880 entries

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

  • Best score: 12
  • Best player score: 17
  • Position: #656 / 851
  • Number of attempts: 1
Add semicolons - 10852 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 12
  • Position: #1951 / 3063
  • Number of attempts: 3
Bad Copy Syntax - 2037 entries

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

  • Best score: 18
  • Best player score: 38
  • Position: #484 / 525
  • Number of attempts: 2
remove lines containing the word "reader" - 3586 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Position: #1067 / 1162
  • Number of attempts: 1
Com(m)a Trouble - 3823 entries

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

  • Best score: 12
  • Best player score: 49
  • Position: #832 / 865
  • Number of attempts: 1
Box it - 7905 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 25
  • Position: #1043 / 1876
  • Number of attempts: 2
Cool or not? - 829 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 22
  • Position: #187 / 230
  • Number of attempts: 1
Two pairs of cluster of letters creates word - 749 entries

Clean and group.

  • Best score: 17
  • Best player score: 40
  • Position: #164 / 178
  • Number of attempts: 1
Extract argument from function - 2357 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #391 / 753
  • Number of attempts: 2
Preferably without multi-cursor plugin - 540 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: #68 / 129
  • Number of attempts: 1
Flip the bit - 130 entries

Change the specific 0 to a 1.

  • Best score: 7
  • Best player score: 9
  • Position: #43 / 74
  • Number of attempts: 2
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3186 / 4197
  • Number of attempts: 2
Python Hello World! Reformatting - 994 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: #40 / 380
  • Number of attempts: 5
Basic renumbering - 5648 entries

Renumbering Basic.

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

Little role switching.

  • Best score: 12
  • Best player score: 20
  • Position: #1883 / 2128
  • Number of attempts: 2
One to Ten - 2219 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 / 672
  • Number of attempts: 1
Line under headers - 2044 entries

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

  • Best score: 24
  • Best player score: 36
  • Position: #396 / 503
  • Number of attempts: 1
Increment each number - 1023 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 22
  • Position: #192 / 248
  • Number of attempts: 1
simple format (3) - 86 entries

reverse two column values!

  • Best score: 34
  • Best player score: 36
  • Position: #12 / 24
  • Number of attempts: 2
Delete to the end of the current line - 812 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 / 391
  • Number of attempts: 1
move titles next to url, in quotes - 534 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 46
  • Position: #137 / 141
  • Number of attempts: 1
Condensed Cases - 804 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: #149 / 247
  • Number of attempts: 2
Pretty format for variable declarations - 170 entries

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

  • Best score: 13
  • Best player score: 21
  • Position: #55 / 64
  • Number of attempts: 1
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #1129 / 4180
  • Number of attempts: 6
Two become one - 713 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: #72 / 208
  • Number of attempts: 4
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #409 / 437
  • Number of attempts: 1
Piphilology - 144 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: 28
  • Best player score: 35
  • Position: #21 / 52
  • Number of attempts: 6
Mess in revision history - 1184 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 24
  • Position: #144 / 250
  • Number of attempts: 6
HTML formatting: vertical alignment for readability - 88 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: 32
  • Best player score: 36
  • Position: #15 / 36
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2506 / 3683
  • Number of attempts: 2
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 21
  • Position: #3515 / 3963
  • Number of attempts: 1
paste indent correction - JS - 112 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 / 59
  • Number of attempts: 2
Execute immediate SQL - 90 entries

Sql string tranformation ...

  • Best score: 58
  • Best player score: 72
  • Position: #18 / 32
  • Number of attempts: 1
Transposition - 99 entries

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

  • Best score: 31
  • Best player score: 36
  • Position: #9 / 32
  • Number of attempts: 3
Groups magic - 158 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 / 93
  • Number of attempts: 1
Sort by your own sum - 86 entries

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

  • Best score: 24
  • Best player score: 26
  • Position: #7 / 30
  • Number of attempts: 7
Circle of Fifths with Sharps - 114 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: #24 / 38
  • Number of attempts: 1
Checkerboard case pattern - 164 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 / 61
  • Number of attempts: 5
Add links to an existing HTML table - 97 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: #17 / 31
  • Number of attempts: 1
Tiny column alignment - 61 entries

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

  • Best score: 33
  • Best player score: 45
  • Position: #14 / 23
  • Number of attempts: 2
maximun and minimun - 73 entries

Find the maximum and minimum of the rows.

  • Best score: 50
  • Best player score: 69
  • Position: #20 / 26
  • Number of attempts: 3
Enharmonic Equivalents - 59 entries

Transform # and b to digraphs

  • Best score: 18
  • Best player score: 19
  • Position: #28 / 37
  • Number of attempts: 1
The holy-grail may help - 366 entries

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

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

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

  • Best score: 56
  • Best player score: 88
  • Position: #24 / 66
  • Number of attempts: 1
Shebangs for all - 1999 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: #329 / 516
  • Number of attempts: 2
Increment, increment, increment.... - 688 entries

Vim likes macros

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

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #464 / 527
  • Number of attempts: 1
Simple text editing with Vim - 12811 entries

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

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

entered into 92 challenges

contributed 0 challenges