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

Insert column data on Confluence-style table - 415 entries

Add ip addresses into new "IP" column based on the last digits from the "Server" column

  • Best score: 33
  • Best player score: 36
  • Position: #26 / 94
  • Number of attempts: 5
Surround the 'z' character with brackets, quotes, and print as formatted string. - 449 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #45 / 248
  • Number of attempts: 2
Easier Align - 257 entries

Align the columns of a markdown table

  • Best score: 57
  • Best player score: 136
  • Position: #25 / 81
  • Number of attempts: 2
Paste a column after a column - 2120 entries

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

  • Best score: 14
  • Best player score: 36
  • Position: #355 / 453
  • Number of attempts: 1
Tabbed Table to Python Array - 604 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: 55
  • Position: #41 / 158
  • Number of attempts: 6
HS exam question - 1420 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 48
  • Position: #21 / 382
  • Number of attempts: 6
Many duplicates - 1189 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #128 / 387
  • Number of attempts: 4
2 quick changes and a numbered list - 573 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: #39 / 138
  • Number of attempts: 5
delete swap - 1454 entries

delete all swap

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #138 / 517
  • Number of attempts: 5
hello-world-vimgolf - 2298 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #371 / 649
  • Number of attempts: 2
Fill in the chess board - 886 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: #67 / 173
  • Number of attempts: 8
Create a diamond comment - 301 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 88
  • Position: #61 / 70
  • Number of attempts: 3
Lowercase first characters - 455 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: #96 / 170
  • Number of attempts: 2
Increment number for every 10 lines - 212 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: #43 / 58
  • Number of attempts: 4
Inverting Lines - 1774 entries

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

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 35
  • Position: #85 / 304
  • Number of attempts: 7
Put a cross in the square - 201 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 24
  • Position: #69 / 83
  • Number of attempts: 1
swap number pairs - 2000 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #97 / 368
  • Number of attempts: 16
Simple, Practical, and Common - 33343 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: #2796 / 7356
  • Number of attempts: 8
Hogwarts Email Sorting - 875 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #101 / 253
  • Number of attempts: 3
One number per line - 18611 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1331 / 3840
  • Number of attempts: 6
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: 13
  • Position: #264 / 840
  • Number of attempts: 4
Bad Copy Syntax - 1999 entries

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

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

This line is too long, split it.

  • Best score: 15
  • Best player score: 21
  • Position: #440 / 629
  • Number of attempts: 5
Com(m)a Trouble - 3636 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #330 / 815
  • Number of attempts: 6
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #265 / 700
  • Number of attempts: 7
Copy three lines - 2839 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 / 634
  • Number of attempts: 10
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: 31
  • Position: #37 / 127
  • Number of attempts: 12
Number Sort - 303 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 / 162
  • Number of attempts: 3
That hyphen - 2554 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Position: #279 / 694
  • Number of attempts: 7
Team names - 1805 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #322 / 581
  • Number of attempts: 3
Learn some german verbs - 531 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 / 131
  • Number of attempts: 12
Subnetting - 111 entries

Split up the IP addresses in the right way.

  • Best score: 29
  • Best player score: 51
  • Position: #32 / 36
  • 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 - 52 entries

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

  • Best score: 22
  • Best player score: 24
  • Position: #34 / 36
  • Number of attempts: 1
Basic renumbering - 5576 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 12
  • Position: #299 / 1255
  • 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 - 303 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #124 / 137
  • Number of attempts: 2
replace 2nd column blanks with values in same column if blank - 231 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 / 81
  • Number of attempts: 8
Sort files from hosts - 179 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #31 / 74
  • Number of attempts: 5
Order and join - 948 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #138 / 254
  • Number of attempts: 3
Paragraph breaks - 505 entries

Swap the blank lines and the aaa lines.

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

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

  • Best score: 24
  • Best player score: 25
  • Position: #45 / 493
  • 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) - 45 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: #9 / 17
  • Number of attempts: 6
Collect List - 4260 entries

Convert to comma separated list.

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

Based on "The name of the game".

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

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 24
  • Position: #53 / 104
  • Number of attempts: 7
Test everything! - 159 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: #16 / 51
  • Number of attempts: 15
Square numbers - 99 entries

Boring math puzzle.

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

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1235 / 4158
  • Number of attempts: 8
learn vim in short time - 228 entries

so happy to learn vim.because vim is awesome

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

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #426 / 1126
  • 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 - 468 entries

Rotate that triangle.

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

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #128 / 267
  • Number of attempts: 5
Don't know what this is - 1978 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: #238 / 578
  • Number of attempts: 4
Counting in binary - 477 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #22 / 113
  • Number of attempts: 26
quotes inside quotes - 3124 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 / 1071
  • 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 - 12848 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1163 / 3943
  • Number of attempts: 6
Assign list - 169 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 36
  • Position: #24 / 59
  • 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 - 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: #39 / 57
  • Number of attempts: 3
Delete unwanted lines - 396 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #186 / 225
  • Number of attempts: 2
Chucking wood - 103 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 / 45
  • Number of attempts: 9
ASCII-art Histogram - 310 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: #17 / 55
  • Number of attempts: 10
citizen_hacks_2019_challenge1 - 48 entries

For the Citizen Hacks 2019 Vim competition

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

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

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

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #997 / 1733
  • Number of attempts: 7
Ugly spreadsheet copy/paste to CSV - 969 entries

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

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

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Position: #74 / 215
  • Number of attempts: 16
A Simple One - 996 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 / 641
  • Number of attempts: 1
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #363 / 454
  • Number of attempts: 5
Increment, increment, increment.... - 643 entries

Vim likes macros

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

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

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

Correct the capitalization of each word

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

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 6
  • Position: #137 / 144
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3278 entries

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

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

entered into 81 challenges

contributed 0 challenges