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

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

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

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 67
  • Position: #20 / 90
  • Number of attempts: 5
Paste a column after a column - 2262 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 / 491
  • Number of attempts: 11
Filter number combinations that don't add to 11 - 376 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 / 110
  • Number of attempts: 5
Tabbed Table to Python Array - 644 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 - 1510 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 59
  • Position: #110 / 397
  • Number of attempts: 6
Substraction (bis) - 578 entries

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

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

Based off of something I saw on reddit

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

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

  • Best score: 15
  • Best player score: 16
  • Position: #49 / 204
  • Number of attempts: 9
Many duplicates - 1253 entries

Quick and easy

  • Best score: 7
  • Best player score: 10
  • Position: #324 / 412
  • Number of attempts: 1
2 quick changes and a numbered list - 599 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: #66 / 145
  • Number of attempts: 2
delete swap - 1527 entries

delete all swap

  • Best score: 5
  • Best player score: 6
  • Position: #357 / 480
  • Number of attempts: 2
Generate a very basic Python constructor (fixed) - 1179 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: #123 / 248
  • Number of attempts: 6
Fix the shell script! - 2344 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 29
  • Position: #203 / 542
  • Number of attempts: 5
Visual block training - 1005 entries

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

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

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

  • Best score: 10
  • Best player score: 12
  • Position: #229 / 525
  • Number of attempts: 3
Java to JavaScript - 257 entries

Let convert some simple Java file to JavaScript!

  • Best score: 59
  • Best player score: 89
  • Position: #38 / 67
  • Number of attempts: 1
Wikitext headings to markdown - 980 entries

Convert the wikitext headings to markdown.

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

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 20
  • Position: #193 / 257
  • Number of attempts: 2
Plotting some variables in python - 1567 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: #122 / 334
  • Number of attempts: 2
Lowercase first characters - 467 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: #59 / 175
  • Number of attempts: 1
RUST match with enum for Coin - 176 entries

RUST match with enum for Coin rusty practice on vimgolf

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 41
  • Position: #132 / 308
  • Number of attempts: 1
Enumerate Bullets - 292 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 / 80
  • Number of attempts: 4
swap number pairs - 2011 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #159 / 370
  • Number of attempts: 4
HS Final exam vimgolf - 864 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: #186 / 227
  • Number of attempts: 1
Easy modification of ssh config - 335 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 26
  • Position: #47 / 104
  • Number of attempts: 4
Python: Def to Lambda - 423 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 24
  • Position: #135 / 149
  • Number of attempts: 1
Rural Post - 4368 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #192 / 1072
  • Number of attempts: 8
Satisfy the go linter - 2329 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: #354 / 457
  • Number of attempts: 3
Add quotes to ansible playbook - 930 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #191 / 296
  • Number of attempts: 3
Multiline to Single Line - 668 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #224 / 292
  • Number of attempts: 1
Capitalize the Names - 361 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: #71 / 91
  • Number of attempts: 2
Yo To Hello - 1115 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #379 / 518
  • Number of attempts: 3
Simple, Practical, and Common - 33385 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: #4504 / 7364
  • Number of attempts: 4
Hogwarts Email Sorting - 877 entries

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

  • Best score: 20
  • Best player score: 26
  • Position: #207 / 254
  • 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 - 6208 entries

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

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

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2570 / 3842
  • Number of attempts: 2
Right Align Part of the line - 117 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: #20 / 38
  • Number of attempts: 5
Quote modules - 1054 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 29
  • Position: #203 / 274
  • Number of attempts: 1
Swap values inside brackets - 2464 entries

Easy challenge.

  • Best score: 14
  • Best player score: 25
  • Position: #505 / 569
  • Number of attempts: 1
Applying same text modification in several lines - 2845 entries

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

  • Best score: 12
  • Best player score: 17
  • Position: #648 / 840
  • Number of attempts: 1
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 12
  • Position: #1938 / 3044
  • Number of attempts: 3
Bad Copy Syntax - 2001 entries

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

  • Best score: 18
  • Best player score: 38
  • Position: #476 / 516
  • Number of attempts: 2
remove lines containing the word "reader" - 3537 entries

easy stuff

  • Best score: 9
  • Best player score: 14
  • Position: #1051 / 1144
  • Number of attempts: 1
Com(m)a Trouble - 3675 entries

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

  • Best score: 12
  • Best player score: 49
  • Position: #796 / 827
  • Number of attempts: 1
Box it - 7828 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 25
  • Position: #1039 / 1865
  • Number of attempts: 2
Cool or not? - 793 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 22
  • Position: #184 / 226
  • Number of attempts: 1
Two pairs of cluster of letters creates word - 735 entries

Clean and group.

  • Best score: 17
  • Best player score: 40
  • Position: #160 / 174
  • Number of attempts: 1
Extract argument from function - 2314 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #386 / 744
  • 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 - 120 entries

Change the specific 0 to a 1.

  • Best score: 8
  • Best player score: 9
  • Position: #41 / 71
  • Number of attempts: 2
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3182 / 4164
  • Number of attempts: 2
Python Hello World! Reformatting - 938 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 / 364
  • Number of attempts: 5
Basic renumbering - 5587 entries

Renumbering Basic.

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

Little role switching.

  • Best score: 12
  • Best player score: 20
  • Position: #1863 / 2101
  • Number of attempts: 2
One to Ten - 2165 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 / 662
  • Number of attempts: 1
Line under headers - 2004 entries

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

  • Best score: 24
  • Best player score: 36
  • Position: #393 / 496
  • Number of attempts: 1
Increment each number - 977 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 22
  • Position: #188 / 242
  • Number of attempts: 1
simple format (3) - 72 entries

reverse two column values!

  • Best score: 34
  • Best player score: 36
  • Position: #11 / 21
  • Number of attempts: 2
Delete to the end of the current line - 791 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 / 385
  • 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 - 788 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: #146 / 242
  • 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 - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #1129 / 4161
  • Number of attempts: 6
Two become one - 710 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 / 205
  • Number of attempts: 4
Where should I put the Newline? - 863 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #406 / 431
  • Number of attempts: 1
Piphilology - 131 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: #20 / 51
  • Number of attempts: 6
Mess in revision history - 1161 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 24
  • Position: #142 / 247
  • 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 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2498 / 3666
  • Number of attempts: 2
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 21
  • Position: #3501 / 3946
  • 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 - 150 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: #68 / 90
  • 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 - 45 entries

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

  • Best score: 33
  • Best player score: 45
  • Position: #12 / 20
  • 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 - 345 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #156 / 205
  • 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 - 1912 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: #321 / 500
  • Number of attempts: 2
Increment, increment, increment.... - 662 entries

Vim likes macros

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

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #452 / 512
  • Number of attempts: 1
Simple text editing with Vim - 12290 entries

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

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

entered into 92 challenges

contributed 0 challenges