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 - 425 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: #27 / 99
  • Number of attempts: 5
Surround the 'z' character with brackets, quotes, and print as formatted string. - 485 entries

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

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

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 136
  • Position: #32 / 89
  • Number of attempts: 2
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: 36
  • Position: #383 / 491
  • Number of attempts: 1
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: 55
  • Position: #43 / 167
  • Number of attempts: 6
HS exam question - 1508 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 48
  • Position: #24 / 396
  • Number of attempts: 6
Many duplicates - 1253 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #128 / 412
  • Number of attempts: 4
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: 38
  • Position: #40 / 145
  • Number of attempts: 5
delete swap - 1525 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #99 / 478
  • Number of attempts: 5
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: 11
  • Position: #138 / 525
  • Number of attempts: 5
hello-world-vimgolf - 2359 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #381 / 666
  • Number of attempts: 2
Fill in the chess board - 905 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: #68 / 175
  • Number of attempts: 8
Create a diamond comment - 314 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 88
  • Position: #63 / 72
  • Number of attempts: 3
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: 41
  • Position: #97 / 175
  • Number of attempts: 2
Increment number for every 10 lines - 219 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: #46 / 61
  • Number of attempts: 4
Inverting Lines - 1832 entries

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

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 35
  • Position: #86 / 307
  • Number of attempts: 7
Put a cross in the square - 203 entries

Put a cross in the square

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

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

  • Best score: 16
  • Best player score: 17
  • Position: #97 / 370
  • Number of attempts: 16
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: 23
  • Position: #2800 / 7364
  • Number of attempts: 8
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: 21
  • Position: #101 / 254
  • Number of attempts: 3
One number per line - 18616 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1331 / 3842
  • 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 - 2001 entries

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

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

This line is too long, split it.

  • Best score: 15
  • Best player score: 21
  • Position: #441 / 630
  • Number of attempts: 5
Com(m)a Trouble - 3675 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #331 / 827
  • 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 - 2840 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 / 635
  • 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 - 305 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 / 163
  • Number of attempts: 3
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Position: #279 / 695
  • 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 - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 12
  • Position: #299 / 1258
  • Number of attempts: 8
Hidden Message - 77 entries

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

  • Best score: 33
  • Best player score: 35
  • Position: #13 / 29
  • 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 - 956 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #138 / 255
  • 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 - 2004 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #46 / 496
  • 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 - 4264 entries

Convert to comma separated list.

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

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #281 / 343
  • 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! - 162 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: #17 / 52
  • 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 - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1236 / 4161
  • Number of attempts: 8
learn vim in short time - 232 entries

so happy to learn vim.because vim is awesome

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

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #426 / 1129
  • Number of attempts: 4
Suffix sort - 254 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: #12 / 65
  • 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 - 732 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #128 / 268
  • 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 - 3125 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 / 1072
  • Number of attempts: 5
Number an outline - 249 entries

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

  • Best score: 25
  • Best player score: 40
  • Position: #29 / 75
  • Number of attempts: 14
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1163 / 3946
  • 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 - 106 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 / 46
  • 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 - 2947 entries

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

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

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #998 / 1736
  • Number of attempts: 7
Ugly spreadsheet copy/paste to CSV - 973 entries

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

  • Best score: 19
  • Best player score: 20
  • Position: #30 / 185
  • Number of attempts: 22
Assignment Alignment - 832 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 - 1001 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 / 643
  • 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.... - 662 entries

Vim likes macros

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

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

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

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #270 / 512
  • Number of attempts: 2
Almost encrypted - 198 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 - 3339 entries

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

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

entered into 81 challenges

contributed 0 challenges