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

html paragraph to table - 249 entries

reformat html paragraph to table

  • Best score: 48
  • Best player score: 53
  • Number of attempts: 3
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!

  • Best score: 28
  • Best player score: 39
  • Number of attempts: 3
Back to the roots - 37 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

  • Best score: 5
  • Best player score: 23
  • Number of attempts: 1
simple format - 2359 entries

make it look better.

  • Best score: 20
  • Best player score: 22
  • Number of attempts: 1
From argument to object - 1051 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
  • Number of attempts: 1
Team names - 1392 entries

The team names are misspelled.

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
ninja substitution - 250 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 2
Array propagate - 227 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 1
Words in parens - 10831 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 1
Change attribute to getter - 85 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 25
  • Number of attempts: 1
-a-b-c- - 2530 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 1
switch variable - 4244 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 12
  • Number of attempts: 1
Adam's challenge - 742 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 19
  • Number of attempts: 2
Com(m)a Trouble - 1261 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 2
replacing each line of a block selection - 2475 entries

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

  • Best score: 17
  • Best player score: 20
  • Number of attempts: 1
comment and uncomment code inline - 765 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 1
Collect List - 3399 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Order and join - 728 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
Basic renumbering - 4508 entries

Renumbering Basic.

  • Best score: 2
  • Best player score: 11
  • Number of attempts: 2
comments galore - 896 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Swap values - 3413 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 2
Change part of a function name in multiple occurrences - 351 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: 14
  • Number of attempts: 1
Delete to the end of the current line - 382 entries

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

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Applying same text modification in several lines - 1456 entries

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

  • Best score: 4
  • Best player score: 13
  • Number of attempts: 1
Cool or not? - 374 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 1
unknown command - 107 entries

I want change 5 words

  • Best score: 6
  • Best player score: 7
  • Number of attempts: 1
Vice versa - 5788 entries

Little role switching.

  • Best score: 2
  • Best player score: 14
  • Number of attempts: 2
Convert Application Output to CSV - 97 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 19
  • Number of attempts: 1
Just the middle - 8973 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 9371 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Put the months in order - 373 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

  • Best score: 23
  • Best player score: 23
  • Number of attempts: 3
Flip the bit - 68 entries

Change the specific 0 to a 1.

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 1
remove lines containing the word "reader" - 1259 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
One to Ten - 754 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
  • Number of attempts: 1
Array transposition - 1515 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 20
  • Number of attempts: 1
I forgot quotes - 11351 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 1
Remove hard line breaks - 39 entries

Text files with Hard breaks are not good for e-readers. We need remove all hard line breaks and have long lines.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 1
Increment each number - 392 entries

Increment each number individually by one

  • Best score: 6
  • Best player score: 18
  • Number of attempts: 1
ASCII Art - 69 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 1
Fiddle percentages into real numbers - 705 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: 14
  • Number of attempts: 1
Norbert
Twitter:

entered into 40 challenges

contributed 0 challenges