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

Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 13
  • Position: #627 / 1268
  • Number of attempts: 3
One number per line - 18732 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1261 / 3865
  • Number of attempts: 4
Swap values inside brackets - 2496 entries

Easy challenge.

  • Best score: 14
  • Best player score: 18
  • Position: #338 / 579
  • Number of attempts: 2
Applying same text modification in several lines - 2880 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #582 / 851
  • Number of attempts: 1
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: 27
  • Position: #141 / 249
  • Number of attempts: 1
Add semicolons - 10859 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #897 / 3064
  • Number of attempts: 2
Bad Copy Syntax - 2037 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #125 / 525
  • Number of attempts: 4
Split line with dots - 2144 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 27
  • Position: #577 / 634
  • Number of attempts: 1
remove lines containing the word "reader" - 3586 entries

easy stuff

  • Best score: 9
  • Best player score: 13
  • Position: #974 / 1162
  • Number of attempts: 1
Com(m)a Trouble - 3823 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #382 / 865
  • Number of attempts: 3
Wrap the text of an email message to 79 characters - 766 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #244 / 410
  • Number of attempts: 1
Box it - 7905 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #853 / 1876
  • Number of attempts: 2
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: #166 / 380
  • Number of attempts: 5
From argument to object - 1508 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: #249 / 458
  • Number of attempts: 3
Two pairs of cluster of letters creates word - 749 entries

Clean and group.

  • Best score: 17
  • Best player score: 20
  • Position: #106 / 178
  • Number of attempts: 1
Search and Replace 0 - 4989 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 14
  • Position: #1038 / 1624
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Position: #372 / 701
  • Number of attempts: 2
Just the middle - 11457 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2840 / 4198
  • Number of attempts: 2
Team names - 1836 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 19
  • Position: #453 / 588
  • Number of attempts: 1
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #170 / 1264
  • Number of attempts: 1
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 15
  • Position: #1098 / 2128
  • Number of attempts: 3
One to Ten - 2219 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: #114 / 672
  • Number of attempts: 1
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: #104 / 208
  • Number of attempts: 4
Line under headers - 2044 entries

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

  • Best score: 24
  • Best player score: 28
  • Position: #216 / 503
  • Number of attempts: 5
Increment each number - 1023 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 22
  • Position: #188 / 248
  • Number of attempts: 1
Delete to the end of the current line - 812 entries

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

  • Best score: 5
  • Best player score: 6
  • Position: #311 / 391
  • Number of attempts: 1
change parenthesis - 296 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 10
  • Position: #101 / 161
  • Number of attempts: 1
Reorder the groups - 1181 entries

Change the order so that the groups of fruit come before the vegetables.

  • Best score: 14
  • Best player score: 18
  • Position: #143 / 264
  • Number of attempts: 3
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #186 / 254
  • Number of attempts: 1
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 16
  • Position: #861 / 1190
  • Number of attempts: 2
I forgot quotes - 15989 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1888 / 4181
  • Number of attempts: 4
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #702 / 1137
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10669 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2383 / 3684
  • Number of attempts: 2
quotes inside quotes - 3159 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: 15
  • Position: #488 / 1078
  • Number of attempts: 3
Words in parens - 12939 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #986 / 3964
  • Number of attempts: 1
NATO phonetic alphabet - 529 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 19
  • Position: #38 / 196
  • Number of attempts: 2
A simple change - 461 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 14
  • Position: #123 / 191
  • Number of attempts: 3
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #314 / 445
  • Number of attempts: 1
Vertical Limit - 2538 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 23
  • Position: #251 / 754
  • Number of attempts: 2
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #285 / 777
  • Number of attempts: 3
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #245 / 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: 7
  • Position: #142 / 263
  • Number of attempts: 2
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #552 / 1748
  • Number of attempts: 2
Sort the cardinal numbers - 310 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 13
  • Position: #64 / 148
  • Number of attempts: 2
PHP Array Syntax -> MailChimp Merge Syntax - 545 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 24
  • Position: #45 / 150
  • Number of attempts: 7
Ruby 1.9 hashes - 1244 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 13
  • Position: #178 / 406
  • Number of attempts: 2
Ruby 1.9 compat - 629 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 15
  • Position: #117 / 234
  • Number of attempts: 2
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #342 / 458
  • Number of attempts: 1
Increment, increment, increment.... - 688 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #27 / 408
  • Number of attempts: 1
Context Insensitive completion 1 - 498 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #139 / 245
  • Number of attempts: 1
Make Fancy Header - 1052 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 17
  • Position: #203 / 344
  • Number of attempts: 1
Simple text editing with Vim - 12815 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1760 / 3696
  • Number of attempts: 2
Nick Yeow
Twitter:

entered into 52 challenges

contributed 0 challenges