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

C Reformatting - 581 entries

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

  • Best score: 30
  • Best player score: 41
  • Number of attempts: 2
Vertical Limit - 2052 entries

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

  • Best score: 21
  • Best player score: 23
  • Number of attempts: 4
Whitespace, empty lines and tabs - 2517 entries

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

  • Best score: 16
  • Best player score: 23
  • Number of attempts: 2
Simple, Practical, and Common - 21855 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: 2
  • Best player score: 22
  • Number of attempts: 6
Learn some german verbs - 326 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 11
  • Best player score: 21
  • Number of attempts: 2
replacing each line of a block selection - 2425 entries

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

  • Best score: 17
  • Best player score: 18
  • Number of attempts: 5
From argument to object - 1016 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
  • Number of attempts: 4
Order and join - 701 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 4
Letter case trickery - 1413 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
  • Number of attempts: 1
Collect List - 3212 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Array transposition - 1332 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 11
I forgot quotes - 10443 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 6
Swap values - 3231 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 6
Team names - 1277 entries

The team names are misspelled.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 4
That hyphen - 1881 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 5
Basic renumbering - 4214 entries

Renumbering Basic.

  • Best score: 2
  • Best player score: 2
  • Number of attempts: 6
Remember VimGolf Rules ! - 181 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
V to the i - 3614 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 9178 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Just the middle - 8609 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Array propagate - 216 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 23
  • Number of attempts: 3
Words in parens - 10478 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 4
Vice versa - 5494 entries

Little role switching.

  • Best score: 2
  • Best player score: 12
  • Number of attempts: 6
Every other line - 1854 entries

AaAaAaA

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 8
Com(m)a Trouble - 872 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 5
Simple text editing with Vim - 10020 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Don't know what this is - 1632 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
  • Number of attempts: 6
Extract argument from function - 1839 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
Scrambled numbers - 696 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 4
Space out the alphabet - 1289 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 6
Applying same text modification in several lines - 1028 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
One number per line - 10902 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 13

Contributed Challenges

Number Sort - 220 entries

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

Long prime list - filter version - 19 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!

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 32 challenges

contributed 2 challenges