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

Put a newline after every 10 lines in vim - 830 entries

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

  • Best score: 10
  • Best player score: 15
  • Position: #242 / 295
  • Number of attempts: 1
xrandr outputs and dashes - 587 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 12
  • Position: #4 / 191
  • Number of attempts: 1
From a Thunderlink to a Markdown link - 694 entries

ThunderLinks are durable hyperlinks to specific email messages generated from Thunderbird in HTML format. Leverage the power of vim to make them suitable for a markdown-formatted file.

  • Best score: 18
  • Best player score: 21
  • Position: #71 / 154
  • Number of attempts: 2
Capitalize the Names - 307 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: 21
  • Position: #2 / 78
  • Number of attempts: 3
Simple, Practical, and Common - 32879 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: #2423 / 7266
  • Number of attempts: 3
Hogwarts Email Sorting - 818 entries

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

  • Best score: 20
  • Best player score: 22
  • Position: #97 / 235
  • Number of attempts: 1
Swap values - 4420 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #361 / 1238
  • Number of attempts: 4
prepend * to every non-blank line - 5946 entries

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

  • Best score: 10
  • Best player score: 12
  • Position: #709 / 1459
  • Number of attempts: 1
One number per line - 18365 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1020 / 3785
  • Number of attempts: 4
add line and index - 81 entries

a missed line and index names need to be added

  • Best score: 44
  • Best player score: 56
  • Position: #16 / 26
  • Number of attempts: 1
Separate the lines - 155 entries

Every other line is mixed up. Separate them into their original texts.

  • Best score: 11
  • Best player score: 11
  • Position: #11 / 84
  • Number of attempts: 1
Swap values inside brackets - 2423 entries

Easy challenge.

  • Best score: 14
  • Best player score: 17
  • Position: #266 / 558
  • Number of attempts: 2
Unsemantic linewrapping - 826 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: 10
  • Position: #97 / 208
  • Number of attempts: 1
V to the i - 4635 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1117 / 1855
  • Number of attempts: 1
Add semicolons - 10527 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1116 / 2986
  • Number of attempts: 1
Bad Copy Syntax - 1926 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #34 / 490
  • Number of attempts: 1
Split line with dots - 2087 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 16
  • Position: #162 / 620
  • Number of attempts: 4
Com(m)a Trouble - 3369 entries

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

  • Best score: 12
  • Best player score: 15
  • Position: #358 / 758
  • Number of attempts: 2
Hash staircase - 39 entries

Can you use a strategy to come up with this pattern?

  • Best score: 21
  • Best player score: 22
  • Position: #13 / 19
  • Number of attempts: 4
Cool or not? - 761 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 16
  • Position: #69 / 216
  • Number of attempts: 1
multiple cursor alternative - 1441 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: 21
  • Position: #194 / 368
  • Number of attempts: 1
From argument to object - 1258 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 18
  • Position: #148 / 416
  • Number of attempts: 3
Array propagate - 309 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 25
  • Position: #42 / 109
  • Number of attempts: 3
Start coding format - 128 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 24
  • Position: #41 / 63
  • Number of attempts: 1
Across-Down Flip - 45 entries

Do this instead of the Sunday crossword.

  • Best score: 23
  • Best player score: 27
  • Position: #9 / 23
  • Number of attempts: 1
Just the middle - 11119 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2084 / 4108
  • Number of attempts: 1
Extract HTML option values from tag values - 77 entries

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

  • Best score: 34
  • Best player score: 37
  • Position: #15 / 35
  • Number of attempts: 1
Team names - 1773 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #17 / 569
  • Number of attempts: 2
Todo list specification - 362 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 37
  • Position: #10 / 166
  • Number of attempts: 1
Subnetting - 102 entries

Split up the IP addresses in the right way.

  • Best score: 29
  • Best player score: 36
  • Position: #19 / 33
  • Number of attempts: 3
For all cases. - 126 entries

In this case... change it! :) Watch the line.

  • Best score: 8
  • Best player score: 8
  • Position: #11 / 90
  • Number of attempts: 1
Stairstep digits - 240 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #62 / 115
  • Number of attempts: 1
Missing Library and a Typo - 830 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

  • Best score: 15
  • Best player score: 16
  • Position: #38 / 204
  • Number of attempts: 3
Basic renumbering - 5422 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #421 / 1225
  • Number of attempts: 4
Simple addition - 293 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 14
  • Position: #72 / 108
  • Number of attempts: 1
Create a table - 302 entries

Convert the given input into a formatted table

  • Best score: 16
  • Best player score: 19
  • Position: #67 / 98
  • Number of attempts: 1
Fiddle percentages into real numbers - 794 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 16
  • Position: #174 / 270
  • Number of attempts: 1
Combines all items - 266 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #6 / 122
  • Number of attempts: 2
underscore_to_camelCase - 147 entries

Pointy haired boss decided we need to switch to camelCase. Let's get this over with.

  • Best score: 14
  • Best player score: 14
  • Position: #11 / 74
  • Number of attempts: 1
Fun With The Diagonal - 96 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #19 / 73
  • Number of attempts: 1
Vice versa - 7508 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #152 / 2038
  • Number of attempts: 4
Free hyphen! - 144 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 9
  • Position: #3 / 79
  • Number of attempts: 1
Paragraph sort - 406 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 17
  • Position: #45 / 118
  • Number of attempts: 2
SQL to YAML - 45 entries

Should be easy with vim, or not?

  • Best score: 72
  • Best player score: 88
  • Position: #13 / 20
  • Number of attempts: 1
Sorting a glossary - 112 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

  • Best score: 6
  • Best player score: 6
  • Position: #18 / 72
  • Number of attempts: 1
Sort files from hosts - 142 entries

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

  • Best score: 15
  • Best player score: 18
  • Position: #30 / 64
  • Number of attempts: 1
Paragraph breaks - 480 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 13
  • Position: #90 / 159
  • Number of attempts: 1
Mirrored text - 162 entries

backward and forward, and long enough to be challenging

  • Best score: 14
  • Best player score: 16
  • Position: #35 / 69
  • Number of attempts: 2
Change attribute to getter - 106 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 24
  • Position: #8 / 45
  • Number of attempts: 1
Scrambled numbers - 772 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 28
  • Position: #131 / 179
  • Number of attempts: 2
Alsa configuration - 481 entries

I'm tweaking my ~/.asoundrc file!

  • Best score: 22
  • Best player score: 22
  • Position: #22 / 123
  • Number of attempts: 6
Hello ${world} - 293 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

  • Best score: 24
  • Best player score: 26
  • Position: #45 / 92
  • Number of attempts: 1
Generate a list of numbers - 274 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 15
  • Position: #71 / 129
  • Number of attempts: 1
One to Ten - 2091 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: 14
  • Position: #374 / 640
  • Number of attempts: 2
Line under headers - 1911 entries

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

  • Best score: 24
  • Best player score: 28
  • Position: #188 / 470
  • Number of attempts: 2
Build a six - 267 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 22
  • Position: #14 / 89
  • Number of attempts: 4
ASCII Art - 80 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Position: #19 / 50
  • Number of attempts: 1
Array transposition - 2295 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 20
  • Position: #202 / 430
  • Number of attempts: 2
From A to B - 552 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #58 / 152
  • Number of attempts: 5
camel riding - 742 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 16
  • Position: #117 / 266
  • Number of attempts: 2
Space out the alphabet - 1575 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 18
  • Position: #213 / 431
  • Number of attempts: 1
Fix the XML - 958 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 24
  • Position: #133 / 279
  • Number of attempts: 1
I forgot quotes - 15710 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #365 / 4108
  • Number of attempts: 3
-a-b-c- - 3107 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #605 / 1109
  • Number of attempts: 2
Gray area - 684 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #89 / 255
  • Number of attempts: 3
Do you demand a shrubbery? - 1091 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 32
  • Position: #266 / 289
  • Number of attempts: 1
Don't know what this is - 1943 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: 13
  • Position: #253 / 570
  • Number of attempts: 2
Where should I put the Newline? - 837 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #170 / 420
  • Number of attempts: 1
Piphilology - 124 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: 38
  • Position: #40 / 49
  • Number of attempts: 1
Shuffle puzzle - 303 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 15
  • Position: #63 / 99
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10531 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #918 / 3636
  • Number of attempts: 2
attr_aligner - 3387 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 20
  • Position: #177 / 683
  • Number of attempts: 4
Letter case trickery - 1537 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 11
  • Position: #271 / 497
  • Number of attempts: 6
quotes inside quotes - 3020 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: #231 / 1043
  • Number of attempts: 2
Words in parens - 12721 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2273 / 3914
  • Number of attempts: 1
Minimalist Limerick - 503 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 32
  • Position: #41 / 167
  • Number of attempts: 5
Enharmonic Equivalents - 53 entries

Transform # and b to digraphs

  • Best score: 18
  • Best player score: 18
  • Position: #11 / 32
  • Number of attempts: 1
replacing each line of a block selection - 2777 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #81 / 731
  • Number of attempts: 2
switch variable - 4901 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #862 / 1698
  • Number of attempts: 3
A Simple One - 912 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: #425 / 606
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2928 entries

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

  • Best score: 16
  • Best player score: 24
  • Position: #308 / 657
  • Number of attempts: 1
Simple text editing with Vim - 11589 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1436 / 3402
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 5974 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 35
  • Position: #359 / 1475
  • Number of attempts: 3
Jan Bundesmann
Twitter:

ATIX, Open-Source, Mordor's sysadmin, Vim-Nerd, Ork, Banjo & Flöte

entered into 83 challenges

contributed 0 challenges