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

Simple, Practical, and Common - 33609 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: 22
  • Position: #1631 / 7415
  • Number of attempts: 6
One number per line - 18722 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #489 / 3860
  • Number of attempts: 7
citizen_hacks_2019_challenge2 - 195 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #15 / 102
  • Number of attempts: 1
Swap values inside brackets - 2493 entries

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #15 / 578
  • Number of attempts: 8
Unsemantic linewrapping - 928 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

  • Best score: 9
  • Best player score: 9
  • Position: #15 / 231
  • Number of attempts: 4
V to the i - 4799 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 7
  • Position: #629 / 1892
  • Number of attempts: 2
Applying same text modification in several lines - 2877 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #114 / 850
  • Number of attempts: 3
SCREAMING_SNAKE_CASE to Title Case - 1214 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

  • Best score: 19
  • Best player score: 28
  • Position: #146 / 249
  • Number of attempts: 1
Add semicolons - 10848 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #141 / 3061
  • Number of attempts: 2
Bad Copy Syntax - 2033 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #89 / 524
  • Number of attempts: 1
remove lines containing the word "reader" - 3583 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #559 / 1161
  • Number of attempts: 1
Com(m)a Trouble - 3815 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #30 / 864
  • Number of attempts: 6
My cafe needs a new menu - 31 entries

Help! My cafe needs a new menu and I've only got this plain-text file from the kitchen. In order to get it printed, I need to transform it into a markdown file with; headings for each type of item, prices on each menu item, dietary options and a key down the bottom.

  • Best score: 126
  • Best player score: 156
  • Position: #6 / 8
  • Number of attempts: 1
Extract wireshark capture filter - 216 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 27
  • Position: #27 / 72
  • Number of attempts: 1
Box it - 7902 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #4 / 1874
  • Number of attempts: 4
Triangular Numbers - 104 entries

Generate the first 50 triangular numbers.

  • Best score: 18
  • Best player score: 18
  • Position: #2 / 29
  • Number of attempts: 3
Cool or not? - 829 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 15
  • Position: #15 / 230
  • Number of attempts: 3
multiple cursor alternative - 1519 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 20
  • Position: #162 / 380
  • Number of attempts: 5
html paragraph to table - 606 entries

reformat html paragraph to table

  • Best score: 48
  • Best player score: 55
  • Position: #48 / 126
  • Number of attempts: 6
Two pairs of cluster of letters creates word - 749 entries

Clean and group.

  • Best score: 17
  • Best player score: 17
  • Position: #3 / 178
  • Number of attempts: 3
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #241 / 703
  • Number of attempts: 2
Convert Application Output to CSV - 203 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 17
  • Position: #8 / 56
  • Number of attempts: 6
Extract argument from function - 2355 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #222 / 752
  • Number of attempts: 5
Kolakoski sequence -- level 1 - 74 entries

Generate the Kolakoski sequence as described by its first 75 terms.

  • Best score: 22
  • Best player score: 22
  • Position: #1 / 19
  • Number of attempts: 5
Across-Down Flip - 68 entries

Do this instead of the Sunday crossword.

  • Best score: 23
  • Best player score: 24
  • Position: #9 / 26
  • Number of attempts: 5
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #197 / 701
  • Number of attempts: 5
Letterbox - 145 entries

Make a box!

  • Best score: 35
  • Best player score: 35
  • Position: #2 / 28
  • Number of attempts: 4
Flip the bit - 130 entries

Change the specific 0 to a 1.

  • Best score: 7
  • Best player score: 10
  • Position: #47 / 74
  • Number of attempts: 1
The D a n k Side of the Moon - 50 entries

You're making a vaporwave cover of The Dark Side of the Moon. So for the tracklisting, you want to: 1. Change the track names to v a p o r c a s e 2. Double the track lengths (since you're slowing them down). Well... let's just double the minutes.

  • Best score: 40
  • Best player score: 40
  • Position: #4 / 17
  • Number of attempts: 2
Just the middle - 11446 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1201 / 4194
  • Number of attempts: 3
Team names - 1836 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #212 / 588
  • Number of attempts: 5
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #159 / 1264
  • Number of attempts: 7
Fun With The Diagonal - 107 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #63 / 81
  • Number of attempts: 1
ninja substitution - 1420 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 14
  • Position: #2 / 267
  • Number of attempts: 4
Vice versa - 7903 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #438 / 2125
  • Number of attempts: 5
7th Birthday - 202 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 27
  • Position: #60 / 75
  • Number of attempts: 2
comments galore - 1045 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #273 / 424
  • Number of attempts: 3
Python challenge - 172 entries

Change the types of the variables in the list from str to float, while keeping the truncation.

  • Best score: 31
  • Best player score: 58
  • Position: #35 / 46
  • Number of attempts: 1
One to Ten - 2209 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: #22 / 669
  • Number of attempts: 3
Change part of a function name in multiple occurrences - 662 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

  • Best score: 14
  • Best player score: 15
  • Position: #97 / 208
  • Number of attempts: 3
Line under headers - 2037 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #93 / 501
  • Number of attempts: 1
Build a six - 294 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 22
  • Position: #5 / 95
  • Number of attempts: 2
Increment each number - 1023 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 15
  • Position: #3 / 248
  • Number of attempts: 7
citizen_hacks_2019_challenge6 - 65 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 3
  • Best player score: 3
  • Position: #1 / 51
  • Number of attempts: 1
snowflake fractal - 51 entries

From step 0 to step 3 of a fractal

  • Best score: 26
  • Best player score: 26
  • Position: #1 / 20
  • Number of attempts: 5
Delete to the end of the current line - 811 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 5
  • Position: #70 / 390
  • Number of attempts: 1
Song Transcription Oops - 243 entries

When transcribing vocal music to Canjo Tab you can start by finding the lowest note and assigning that to zero and working your way up from there. However, without fail, I tend to miscount the notes and when I am near done I find a lower note. I mark this with a "z". This means I have to increase all the previous ones by 1. just a sting of numbers :)

  • Best score: 15
  • Best player score: 15
  • Position: #25 / 78
  • Number of attempts: 1
Label grid cells (6x6) - 53 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: 31
  • Position: #1 / 20
  • Number of attempts: 2
Put the months in order - 974 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

  • Best score: 20
  • Best player score: 30
  • Position: #47 / 163
  • Number of attempts: 3
move titles next to url, in quotes - 529 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 22
  • Position: #69 / 139
  • Number of attempts: 2
Array transposition - 2416 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 21
  • Position: #243 / 447
  • Number of attempts: 3
Sierpinski's Triangle - 86 entries

Build the famous fractal, Sierpinski's Triangle.

  • Best score: 25
  • Best player score: 26
  • Position: #8 / 27
  • Number of attempts: 3
Kolakoski sequence -- level 2 - 16 entries

This time, the line above describes the line below. Level 1 at: http://www.vimgolf.com/challenges/5c880211ab65cb00065c74eb

  • Best score: 37
  • Best player score: 38
  • Position: #2 / 8
  • Number of attempts: 4
Simple format (2) - 335 entries

try again!

  • Best score: 23
  • Best player score: 38
  • Position: #57 / 70
  • Number of attempts: 1
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #409 / 1190
  • Number of attempts: 4
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Position: #91 / 444
  • Number of attempts: 5
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #247 / 1137
  • Number of attempts: 3
Permutations N=4 - 61 entries

Could use backtracking or other algorithm to generate sorted numbers. Second chance !

  • Best score: 25
  • Best player score: 25
  • Position: #5 / 19
  • Number of attempts: 9
A HAPPY NEW YEAR 2014 ! - 10658 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2365 / 3680
  • Number of attempts: 1
Counting in binary - 526 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #11 / 117
  • Number of attempts: 4
Words in parens - 12929 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #955 / 3961
  • Number of attempts: 4
Draw the Go board - 149 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: 69
  • Position: #28 / 51
  • Number of attempts: 1
Resort and deup a CSV list - 167 entries

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

  • Best score: 44
  • Best player score: 44
  • Position: #1 / 43
  • Number of attempts: 5
[Real World] PHP To Markdown - 33 entries

Fun refactoring I had to do in the real world. This presents several challenges: - How to create a table that fits the informations exactly - How to keep track of two informations per line while doing the refactoring - Generate the link from the actual text Have fun!

  • Best score: 141
  • Best player score: 178
  • Position: #8 / 9
  • Number of attempts: 1
Pascal's Triangle - 38 entries

Generate the first 17 left-justified rows of Pascal's triangle.

  • Best score: 36
  • Best player score: 36
  • Position: #3 / 17
  • Number of attempts: 4
ASCII-art Histogram - 320 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: 62
  • Position: #41 / 57
  • Number of attempts: 1
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #244 / 419
  • Number of attempts: 1
Remove semicolons after expressions - 654 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #99 / 263
  • Number of attempts: 3
Generate Fibonacci Numbers - 280 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 23
  • Position: #64 / 100
  • Number of attempts: 1
Simple text editing with Vim - 12744 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #567 / 3681
  • Number of attempts: 3

Contributed Challenges

Kolakoski sequence -- level 2 - 16 entries

This time, the line above describes the line below. Level 1 at: http://www.vimgolf.com/challenges/5c880211ab65cb00065c74eb

snowflake fractal - 51 entries

From step 0 to step 3 of a fractal

ninja substitution - 1420 entries

How can you reuse a previous substitution ?

Kolakoski sequence -- level 1 - 74 entries

Generate the Kolakoski sequence as described by its first 75 terms.

Box it - 7902 entries

Create a box around a line.

𝚃𝚒𝚝𝚘𝚞𝚊𝚗 𝚃𝚎𝚢𝚜𝚜𝚒𝚎𝚛
Twitter:

entered into 70 challenges

contributed 5 challenges