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

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

  • Best score: 17
  • Best player score: 17
  • Position: #13 / 287
  • Number of attempts: 1
Easier Align - 358 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 - 2413 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 / 523
  • Number of attempts: 11
Filter number combinations that don't add to 11 - 379 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: #56 / 112
  • Number of attempts: 5
Tabbed Table to Python Array - 652 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: #72 / 171
  • Number of attempts: 2
HS exam question - 1523 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 59
  • Position: #111 / 404
  • Number of attempts: 6
Substraction (bis) - 582 entries

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

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

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 43
  • Position: #64 / 90
  • Number of attempts: 3
Poorly indented Python comments - 1275 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #55 / 213
  • Number of attempts: 9
Many duplicates - 1350 entries

Quick and easy

  • Best score: 7
  • Best player score: 10
  • Position: #348 / 440
  • Number of attempts: 1
2 quick changes and a numbered list - 615 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 / 148
  • Number of attempts: 2
delete swap - 1650 entries

delete all swap

  • Best score: 5
  • Best player score: 6
  • Position: #382 / 514
  • Number of attempts: 2
Generate a very basic Python constructor (fixed) - 1231 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: #129 / 260
  • Number of attempts: 6
Fix the shell script! - 2431 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 29
  • Position: #209 / 569
  • Number of attempts: 5
Visual block training - 1047 entries

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

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

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

  • Best score: 10
  • Best player score: 12
  • Position: #236 / 551
  • Number of attempts: 3
Java to JavaScript - 267 entries

Let convert some simple Java file to JavaScript!

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

Convert the wikitext headings to markdown.

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

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #200 / 268
  • Number of attempts: 2
Plotting some variables in python - 1605 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: #124 / 345
  • Number of attempts: 2
Lowercase first characters - 484 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 / 181
  • 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. - 312 entries

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 41
  • Position: #136 / 316
  • Number of attempts: 1
Enumerate Bullets - 309 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 - 2023 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #160 / 373
  • Number of attempts: 4
HS Final exam vimgolf - 892 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: #192 / 234
  • Number of attempts: 1
Easy modification of ssh config - 348 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 26
  • Position: #49 / 108
  • Number of attempts: 4
Python: Def to Lambda - 441 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 24
  • Position: #139 / 154
  • Number of attempts: 1
Rural Post - 4427 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #192 / 1086
  • Number of attempts: 8
Satisfy the go linter - 2360 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: #358 / 465
  • Number of attempts: 3
Add quotes to ansible playbook - 946 entries

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

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

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

  • Best score: 5
  • Best player score: 5
  • Position: #224 / 298
  • Number of attempts: 1
Capitalize the Names - 382 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: #75 / 95
  • Number of attempts: 2
Yo To Hello - 1127 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #379 / 522
  • Number of attempts: 3
Simple, Practical, and Common - 33483 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: #4513 / 7384
  • Number of attempts: 4
Hogwarts Email Sorting - 891 entries

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

  • Best score: 20
  • Best player score: 26
  • Position: #210 / 257
  • 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 - 6254 entries

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

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

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2576 / 3852
  • 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 - 1066 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #206 / 278
  • Number of attempts: 1
Swap values inside brackets - 2477 entries

Easy challenge.

  • Best score: 14
  • Best player score: 25
  • Position: #509 / 573
  • 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 - 10831 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 12
  • Position: #1945 / 3055
  • Number of attempts: 3
Bad Copy Syntax - 2009 entries

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

  • Best score: 18
  • Best player score: 38
  • Position: #478 / 518
  • Number of attempts: 2
remove lines containing the word "reader" - 3556 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Position: #1058 / 1151
  • Number of attempts: 1
Com(m)a Trouble - 3711 entries

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

  • Best score: 12
  • Best player score: 49
  • Position: #808 / 839
  • Number of attempts: 1
Box it - 7849 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 25
  • Position: #1042 / 1870
  • 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 - 747 entries

Clean and group.

  • Best score: 17
  • Best player score: 40
  • Position: #163 / 177
  • Number of attempts: 1
Extract argument from function - 2337 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #390 / 750
  • Number of attempts: 2
Preferably without multi-cursor plugin - 539 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 / 128
  • Number of attempts: 1
Flip the bit - 126 entries

Change the specific 0 to a 1.

  • Best score: 7
  • Best player score: 9
  • Position: #42 / 73
  • Number of attempts: 2
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3184 / 4174
  • Number of attempts: 2
Python Hello World! Reformatting - 955 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: #38 / 371
  • Number of attempts: 5
Basic renumbering - 5605 entries

Renumbering Basic.

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

Little role switching.

  • Best score: 12
  • Best player score: 20
  • Position: #1873 / 2114
  • 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 - 2023 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 - 995 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 22
  • Position: #190 / 245
  • 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 - 795 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 - 510 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 46
  • Position: #133 / 137
  • Number of attempts: 1
Condensed Cases - 794 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: #148 / 244
  • Number of attempts: 2
Pretty format for variable declarations - 156 entries

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

  • Best score: 13
  • Best player score: 21
  • Position: #54 / 63
  • Number of attempts: 1
I forgot quotes - 15946 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #1129 / 4166
  • 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? - 874 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #408 / 436
  • Number of attempts: 1
Piphilology - 143 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 - 1183 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 24
  • Position: #144 / 249
  • Number of attempts: 6
HTML formatting: vertical alignment for readability - 67 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: #14 / 35
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2503 / 3677
  • Number of attempts: 2
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 21
  • Position: #3503 / 3950
  • Number of attempts: 1
paste indent correction - JS - 103 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 / 58
  • Number of attempts: 2
Execute immediate SQL - 87 entries

Sql string tranformation ...

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

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

  • Best score: 31
  • Best player score: 36
  • Position: #9 / 31
  • 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 - 74 entries

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

  • Best score: 25
  • Best player score: 26
  • Position: #6 / 29
  • Number of attempts: 7
Circle of Fifths with Sharps - 97 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: #23 / 37
  • Number of attempts: 1
Checkerboard case pattern - 149 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 / 59
  • Number of attempts: 5
Add links to an existing HTML table - 78 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: #16 / 30
  • 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 - 59 entries

Find the maximum and minimum of the rows.

  • Best score: 50
  • Best player score: 69
  • Position: #19 / 25
  • Number of attempts: 3
Enharmonic Equivalents - 57 entries

Transform # and b to digraphs

  • Best score: 18
  • Best player score: 19
  • Position: #28 / 36
  • 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 - 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 - 1917 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 / 502
  • Number of attempts: 2
Increment, increment, increment.... - 668 entries

Vim likes macros

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

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #456 / 517
  • Number of attempts: 1
Simple text editing with Vim - 12491 entries

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

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

entered into 92 challenges

contributed 0 challenges