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

Tabbed Table to Python Array - 227 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: 52
  • Best player score: 55
  • Position: #16 / 65
  • Number of attempts: 6
HS exam question - 905 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 48
  • Position: #16 / 247
  • Number of attempts: 6
Many duplicates - 719 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #112 / 242
  • Number of attempts: 4
2 quick changes and a numbered list - 384 entries

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

  • Best score: 37
  • Best player score: 38
  • Position: #32 / 94
  • Number of attempts: 5
delete swap - 830 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #99 / 279
  • Number of attempts: 5
Put a newline after every 10 lines in vim - 1228 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #128 / 423
  • Number of attempts: 5
hello-world-vimgolf - 1850 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #308 / 526
  • Number of attempts: 2
Fill in the chess board - 700 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 29
  • Position: #55 / 147
  • Number of attempts: 8
Create a diamond comment - 265 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 88
  • Position: #52 / 61
  • Number of attempts: 3
Lowercase first characters - 406 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: 41
  • Position: #81 / 145
  • Number of attempts: 2
Increment number for every 10 lines - 177 entries

The file consists of 2 columns (code and percentage). We need to add 2 more columns with increasing number for 4th column (Xcols) and increment 3rd column (Ycols) only for every 10 lines with reset of 4th column

  • Best score: 25
  • Best player score: 64
  • Position: #37 / 51
  • Number of attempts: 4
Inverting Lines - 1472 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #167 / 400
  • Number of attempts: 4
Making 3 line function a one liner. - 205 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #99 / 135
  • Number of attempts: 2
Modernise code - 1032 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 35
  • Position: #78 / 235
  • Number of attempts: 7
Put a cross in the square - 148 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 24
  • Position: #58 / 65
  • Number of attempts: 1
swap number pairs - 1808 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #94 / 332
  • Number of attempts: 16
Simple, Practical, and Common - 33073 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: 23
  • Position: #2775 / 7295
  • Number of attempts: 8
Hogwarts Email Sorting - 841 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #97 / 243
  • Number of attempts: 3
One number per line - 18472 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1318 / 3807
  • Number of attempts: 6
Applying same text modification in several lines - 2779 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #258 / 823
  • Number of attempts: 4
Bad Copy Syntax - 1952 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #32 / 498
  • Number of attempts: 9
Split line with dots - 2113 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 21
  • Position: #439 / 625
  • Number of attempts: 5
Com(m)a Trouble - 3477 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #320 / 779
  • Number of attempts: 6
Every other line - 2850 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #264 / 690
  • Number of attempts: 7
Copy three lines - 2819 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #182 / 629
  • Number of attempts: 10
Preferably without multi-cursor plugin - 510 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: 31
  • Position: #36 / 122
  • Number of attempts: 12
Number Sort - 298 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: #129 / 158
  • Number of attempts: 3
That hyphen - 2520 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Position: #278 / 688
  • Number of attempts: 7
Team names - 1789 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #319 / 574
  • Number of attempts: 3
Learn some german verbs - 527 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 21
  • Position: #53 / 129
  • Number of attempts: 12
Subnetting - 105 entries

Split up the IP addresses in the right way.

  • Best score: 29
  • Best player score: 51
  • Position: #30 / 34
  • Number of attempts: 3
Lenny Spiral - 13 entries

Make one lenny into an infinite army of lennys.

  • Best score: 35
  • Best player score: 36
  • Position: #6 / 6
  • Number of attempts: 1
Back to the roots - 47 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

  • Best score: 23
  • Best player score: 24
  • Position: #31 / 33
  • Number of attempts: 1
Basic renumbering - 5484 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 12
  • Position: #291 / 1241
  • Number of attempts: 8
Hidden Message - 74 entries

Find the hidden message and replace all other characters with spaces.

  • Best score: 33
  • Best player score: 35
  • Position: #13 / 28
  • Number of attempts: 11
Combines all items - 290 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 10
  • Position: #122 / 131
  • Number of attempts: 2
replace 2nd column blanks with values in same column if blank - 226 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: 16
  • Position: #38 / 78
  • Number of attempts: 8
Sort files from hosts - 167 entries

Resume files by host. I hope you enjoy with this challenge

  • Best score: 15
  • Best player score: 16
  • Position: #30 / 70
  • Number of attempts: 5
Order and join - 913 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #136 / 248
  • Number of attempts: 3
Paragraph breaks - 497 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 11
  • Position: #84 / 163
  • Number of attempts: 5
Line under headers - 1933 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #43 / 476
  • Number of attempts: 5
Hail to Alekseï Pajitnov - 33 entries

Wanna play tetris? Don't panic, it's quite long but there's no piece rotation. Little advice: source the file, Luke!

  • Best score: 51
  • Best player score: 64
  • Position: #11 / 13
  • Number of attempts: 3
Label grid cells (6x6) - 34 entries

Label the cells of a grid with its coordinates. Rows are labelled top to bottom from A to F, and columns left to right from A to F. Each cell has a coordinate MN, where M is the row letter and N is the column letter.

  • Best score: 31
  • Best player score: 33
  • Position: #7 / 15
  • Number of attempts: 6
Collect List - 4207 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #519 / 1174
  • Number of attempts: 3
VimGolfNight - 517 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #281 / 337
  • Number of attempts: 7
ASCII box - 324 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 24
  • Position: #53 / 103
  • Number of attempts: 7
Test everything! - 152 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 25
  • Position: #15 / 49
  • Number of attempts: 15
Square numbers - 91 entries

Boring math puzzle.

  • Best score: 16
  • Best player score: 39
  • Position: #35 / 37
  • Number of attempts: 5
I forgot quotes - 15822 entries

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1230 / 4129
  • Number of attempts: 8
learn vim in short time - 221 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #125 / 152
  • Number of attempts: 1
-a-b-c- - 3135 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #423 / 1118
  • Number of attempts: 4
Suffix sort - 244 entries

Sort from the end of the line, as if the letters in each line were reversed.

  • Best score: 19
  • Best player score: 20
  • Position: #11 / 64
  • Number of attempts: 16
120 Degrees - 457 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #37 / 142
  • Number of attempts: 13
Gray area - 712 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #127 / 264
  • Number of attempts: 5
Don't know what this is - 1959 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 12
  • Position: #236 / 574
  • Number of attempts: 4
Counting in binary - 443 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

  • Best score: 16
  • Best player score: 17
  • Position: #22 / 111
  • Number of attempts: 26
quotes inside quotes - 3077 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 14
  • Position: #351 / 1057
  • Number of attempts: 5
Number an outline - 246 entries

The indent and words are right, but the numbers are all wrong.

  • Best score: 25
  • Best player score: 40
  • Position: #28 / 74
  • Number of attempts: 14
Words in parens - 12786 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1160 / 3928
  • Number of attempts: 6
Assign list - 166 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 36
  • Position: #24 / 58
  • Number of attempts: 13
Draw the Go board - 140 entries

which is a 19×19 lines board. Here we use ascii characters only for simplicity. See diff file to get a sense. (See also http://en.wikipedia.org/wiki/Go_(game))

  • Best score: 50
  • Best player score: 80
  • Position: #43 / 48
  • Number of attempts: 2
paste indent correction - JS - 97 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: #39 / 55
  • Number of attempts: 3
Delete unwanted lines - 390 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #186 / 223
  • Number of attempts: 2
Chucking wood - 92 entries

An exercise in compressing repetitive text. For this challenge, any entry that uses keys outside the main row (such as arrow keys, Home, End, Delete, etc.) will be removed. (Esc is OK, though you should be using C-[ anyway.)

  • Best score: 51
  • Best player score: 53
  • Position: #8 / 40
  • Number of attempts: 9
ASCII-art Histogram - 295 entries

Create an ASCCI-art histogram for the given numbers. Make sure not to leave trailing whitespaces. Thanks to VimGolf I recently discovered a feature of Vim thAT blew my mind. I'm curious to see what real ninjas make of it ;-)

  • Best score: 33
  • Best player score: 34
  • Position: #16 / 52
  • Number of attempts: 10
citizen_hacks_2019_challenge1 - 44 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 5
  • Best player score: 5
  • Position: #28 / 38
  • Number of attempts: 1
replacing each line of a block selection - 2874 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 18
  • Position: #129 / 753
  • Number of attempts: 9
switch variable - 4978 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #991 / 1716
  • Number of attempts: 7
Ugly spreadsheet copy/paste to CSV - 926 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 20
  • Position: #30 / 179
  • Number of attempts: 22
Assignment Alignment - 823 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Position: #74 / 214
  • Number of attempts: 16
A Simple One - 968 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #550 / 629
  • Number of attempts: 1
Reverse Simple Deletion - 811 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #362 / 445
  • Number of attempts: 5
Increment, increment, increment.... - 603 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #52 / 383
  • Number of attempts: 1
Hatsuyume - 433 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 16
  • Best player score: 16
  • Position: #10 / 171
  • Number of attempts: 4
The Cake is a Lie - 1245 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #270 / 499
  • Number of attempts: 2
Almost encrypted - 194 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 6
  • Position: #136 / 143
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3093 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 16
  • Position: #27 / 684
  • Number of attempts: 11
z00master
Twitter:

entered into 77 challenges

contributed 0 challenges