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

Create a diamond comment - 301 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 44
  • Position: #46 / 70
  • Number of attempts: 2
Simple, Practical, and Common - 33353 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: #1288 / 7358
  • Number of attempts: 6
Swap values - 4535 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #218 / 1255
  • Number of attempts: 6
One number per line - 18613 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #459 / 3841
  • Number of attempts: 13
V to the i - 4743 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #547 / 1878
  • Number of attempts: 3
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: 14
  • Position: #272 / 840
  • Number of attempts: 2
Add semicolons - 10785 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #911 / 3042
  • Number of attempts: 2
Com(m)a Trouble - 3654 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #191 / 821
  • Number of attempts: 5
Cool or not? - 793 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 15
  • Position: #4 / 226
  • Number of attempts: 4
From argument to object - 1474 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: 17
  • Position: #88 / 450
  • Number of attempts: 4
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 12
  • Position: #12 / 700
  • Number of attempts: 8
Array propagate - 319 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 23
  • Position: #11 / 115
  • Number of attempts: 3
Extract argument from function - 2308 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #201 / 742
  • Number of attempts: 6
That hyphen - 2554 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #174 / 694
  • Number of attempts: 5
Just the middle - 11346 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1064 / 4160
  • Number of attempts: 3
Team names - 1805 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #118 / 581
  • Number of attempts: 4
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: #12 / 131
  • Number of attempts: 2
Remember VimGolf Rules ! - 257 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #84 / 138
  • Number of attempts: 1
Basic renumbering - 5584 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 17
  • Position: #583 / 1257
  • Number of attempts: 5
Vice versa - 7778 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #350 / 2095
  • Number of attempts: 6
C Reformatting - 688 entries

You may use Visual mode... or not. #uppercase

  • Best score: 30
  • Best player score: 41
  • Position: #66 / 161
  • Number of attempts: 2
Order and join - 948 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Position: #51 / 254
  • Number of attempts: 4
Scrambled numbers - 779 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 18
  • Position: #37 / 182
  • Number of attempts: 4
Array transposition - 2378 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 17
  • Position: #104 / 443
  • Number of attempts: 11
Collect List - 4261 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #364 / 1185
  • Number of attempts: 2
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Position: #86 / 440
  • Number of attempts: 6
I forgot quotes - 15922 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #716 / 4159
  • Number of attempts: 6
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: 11
  • Position: #95 / 578
  • Number of attempts: 6
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1240 / 3663
  • Number of attempts: 3
Letter case trickery - 1594 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: 12
  • Position: #351 / 511
  • Number of attempts: 1
Words in parens - 12848 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #861 / 3943
  • Number of attempts: 4
Vertical Limit - 2436 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #235 / 735
  • Number of attempts: 4
replacing each line of a block selection - 2925 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #103 / 764
  • Number of attempts: 5
Whitespace, empty lines and tabs - 3290 entries

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

  • Best score: 16
  • Best player score: 23
  • Position: #327 / 729
  • Number of attempts: 2
Simple text editing with Vim - 12233 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #519 / 3567
  • Number of attempts: 3

Contributed Challenges

Long prime list - filter version - 26 entries

I've used the maximum input/diff/output size allowed by vimgolf to get a list of integers up to 1460 separated by newlines, and your goal is to only keep the lines containing primes. There are 232 of them I hope some of you will golf vimscript itself to create some function to run as a primality check for each line, which is a good exercise if you haven't done much vimscript yet! You're invited to also try copy-pasting and doing other non-smart text manipulation. Even more interesting would be to see a solution that uses text manipulation to do the filtering! Whether you use vimscript, normal-mode primality checks, or text manipulation, as long as the end result is valid, your answer will be valid! Let's see which method does better here. Best of luck!

Number Sort - 303 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

towc
Twitter:

I live in the woods and come on the internet to lurk at night because I like learning when nobody's watching

entered into 35 challenges

contributed 2 challenges