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 - 336 entries

Encapsulate the text in a diamond pattern.

  • Best score: 27
  • Best player score: 44
  • Position: #49 / 74
  • Number of attempts: 2
Simple, Practical, and Common - 33483 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 / 7384
  • Number of attempts: 6
Swap values - 4554 entries

Well, swap the values...

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

Just give me the numbers.

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

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

  • Best score: 7
  • Best player score: 7
  • Position: #547 / 1887
  • Number of attempts: 3
Applying same text modification in several lines - 2851 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #273 / 843
  • Number of attempts: 2
Add semicolons - 10831 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #915 / 3055
  • Number of attempts: 2
Com(m)a Trouble - 3711 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #194 / 839
  • Number of attempts: 5
Cool or not? - 802 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 15
  • Position: #4 / 228
  • Number of attempts: 4
From argument to object - 1481 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 / 453
  • Number of attempts: 4
Every other line - 2902 entries

AaAaAaA

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

Complete the array with the keys as part of the value

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

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

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

"vim vi improved"

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

Delete the instructions at the top and bottom.

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

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #118 / 585
  • Number of attempts: 4
Learn some german verbs - 532 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 / 132
  • Number of attempts: 2
Remember VimGolf Rules ! - 259 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #85 / 139
  • Number of attempts: 1
Basic renumbering - 5605 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 17
  • Position: #585 / 1260
  • Number of attempts: 5
Vice versa - 7865 entries

Little role switching.

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

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

  • Best score: 30
  • Best player score: 41
  • Position: #67 / 162
  • Number of attempts: 2
Order and join - 965 entries

There's something special about the input order.

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

Four is NOT 1. One is 1.

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

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 17
  • Position: #106 / 445
  • Number of attempts: 11
Collect List - 4267 entries

Convert to comma separated list.

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

Put 3 spaces between adjacent letters.

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

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #716 / 4166
  • Number of attempts: 6
Don't know what this is - 1996 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 / 581
  • Number of attempts: 6
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1240 / 3677
  • Number of attempts: 3
Letter case trickery - 1598 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: #352 / 514
  • Number of attempts: 1
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #862 / 3950
  • Number of attempts: 4
Vertical Limit - 2487 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #238 / 748
  • Number of attempts: 4
replacing each line of a block selection - 2966 entries

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

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

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

  • Best score: 16
  • Best player score: 23
  • Position: #346 / 758
  • Number of attempts: 2
Simple text editing with Vim - 12491 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 / 3626
  • Number of attempts: 3

Contributed Challenges

Long prime list - filter version - 28 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 - 307 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