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

months to html list items - 960 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 22
  • Position: #9 / 256
  • Number of attempts: 5
Easier Align - 393 entries

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 62
  • Position: #15 / 95
  • Number of attempts: 2
Paste a column after a column - 2514 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 14
  • Position: #91 / 548
  • Number of attempts: 1
2 quick changes and a numbered list - 647 entries

The ascii will not be lost, but rather numbered in 4 digit blocks with leading zeros.

  • Best score: 37
  • Best player score: 41
  • Position: #59 / 154
  • Number of attempts: 2
delete swap - 1773 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #317 / 549
  • Number of attempts: 1
Generate a very basic Python constructor (fixed) - 1253 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 29
  • Position: #61 / 271
  • Number of attempts: 16
Visual block training - 1069 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 17
  • Position: #10 / 203
  • Number of attempts: 2
Inverting Lines - 1882 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 10
  • Position: #221 / 509
  • Number of attempts: 1
CSV to MD format - 413 entries

To convert a CSV list to Markdown list

  • Best score: 36
  • Best player score: 40
  • Position: #32 / 94
  • Number of attempts: 6
Making 3 line function a one liner. - 325 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #170 / 202
  • Number of attempts: 1
Modernise code - 1388 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #70 / 319
  • Number of attempts: 5
Simple, Practical, and Common - 33584 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: #2394 / 7407
  • Number of attempts: 2
Wget failed to download redirections - 202 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 16
  • Position: #16 / 65
  • Number of attempts: 3
Interweave two blocks of text - 659 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 15
  • Position: #33 / 214
  • Number of attempts: 1
Extended Customer 2 - 49 entries

Format the chars

  • Best score: 47
  • Best player score: 59
  • Position: #5 / 21
  • Number of attempts: 3
Basic renumbering - 5645 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 12
  • Position: #305 / 1263
  • Number of attempts: 1
Create Leading Zeros - 239 entries

Create leading zeros only for id columns. Please use generic approach!

  • Best score: 23
  • Best player score: 23
  • Position: #9 / 81
  • Number of attempts: 6
Add to end of each line... kinda - 333 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Position: #109 / 174
  • Number of attempts: 1
JSON string rotation - 60 entries

Right value strings are misplaced. Just rotate them! I'm too kind with you guys and didn't included "strings with \" in it"!

  • Best score: 19
  • Best player score: 19
  • Position: #7 / 21
  • Number of attempts: 4
Vice versa - 7903 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #619 / 2125
  • Number of attempts: 8
Vim's not included features - 240 entries

Filter not included (-) features in a hypothetical installation of vim.

  • Best score: 23
  • Best player score: 23
  • Position: #8 / 65
  • Number of attempts: 11
comments galore - 1041 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #302 / 423
  • Number of attempts: 1
Replace and keep the case - 437 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 26
  • Position: #55 / 118
  • Number of attempts: 2
Sudoku table - 92 entries

Make this simple sudoku table look nice and legible.

  • Best score: 48
  • Best player score: 48
  • Position: #4 / 34
  • Number of attempts: 8
Put the months in order - 974 entries

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

  • Best score: 20
  • Best player score: 20
  • Position: #22 / 163
  • Number of attempts: 1
Separating firstname & lastname - 138 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 19
  • Position: #7 / 57
  • Number of attempts: 3
Restore order to the alphabet - 201 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 12
  • Position: #13 / 72
  • Number of attempts: 4
Assign numbers to fields - 116 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 19
  • Position: #27 / 62
  • Number of attempts: 1
Entries sort - 90 entries

It cames to my mind a weird idea : sorting parts of my .vimrc. Take few minutes to sort out this, it's easy !

  • Best score: 14
  • Best player score: 15
  • Position: #23 / 40
  • Number of attempts: 1
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #528 / 1190
  • Number of attempts: 1
swap or reverse - 126 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Position: #54 / 69
  • Number of attempts: 3
readability - 327 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 19
  • Position: #135 / 152
  • Number of attempts: 2
Interleave lines - 185 entries

This is some kind of « paste -d'\n' c b a ». There are many ways to achieve this.. just find the shortest!

  • Best score: 17
  • Best player score: 18
  • Position: #13 / 60
  • Number of attempts: 10
Merge blank lines and properly capitalize - 82 entries

Here you need complete 2 tasks: 1. Remove all unwanted continuous blank lines and leave only 1 blank line between paragraphs. 2. Properly capitalize the sentences.

  • Best score: 21
  • Best player score: 21
  • Position: #4 / 24
  • Number of attempts: 9
Fix the XML - 1039 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 18
  • Position: #64 / 290
  • Number of attempts: 6
Line 'em up! - 421 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 18
  • Position: #57 / 114
  • Number of attempts: 1
Remove hard line breaks - 74 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: 13
  • Position: #12 / 34
  • Number of attempts: 1
Greek column realign - 51 entries

Oops one letter is missing! Shift down the second column to insert nu letter. Symbol can be entered using: <C-K>n*

  • Best score: 19
  • Best player score: 26
  • Position: #18 / 25
  • Number of attempts: 6
Sorting database text output - 223 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

  • Best score: 24
  • Best player score: 24
  • Position: #39 / 83
  • Number of attempts: 6
Test everything! - 186 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 23
  • Position: #11 / 54
  • Number of attempts: 3
Condensed Cases - 800 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 13
  • Position: #100 / 245
  • Number of attempts: 6
Pretty format for variable declarations - 170 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 13
  • Best player score: 14
  • Position: #25 / 64
  • Number of attempts: 1
Happy TvvO - 426 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 13
  • Position: #182 / 205
  • Number of attempts: 1
I forgot quotes - 15974 entries

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1242 / 4175
  • Number of attempts: 4
learn vim in short time - 240 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #129 / 161
  • Number of attempts: 1
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #736 / 1137
  • Number of attempts: 1
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #134 / 354
  • Number of attempts: 2
Suffix sort - 270 entries

Sort from the end of the line, as if the letters in each line were reversed.

  • Best score: 19
  • Best player score: 19
  • Position: #10 / 67
  • Number of attempts: 10
Five Pillars - 63 entries

Arrange all words in a table with 5 columns. The minimal space between words in columns is 2 spaces. Columns do have varying width.

  • Best score: 41
  • Best player score: 43
  • Position: #6 / 24
  • Number of attempts: 2
Going underground.... - 350 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 23
  • Position: #8 / 127
  • Number of attempts: 9
A HAPPY NEW YEAR 2014 ! - 10657 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2508 / 3679
  • Number of attempts: 2
quotes inside quotes - 3157 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: 14
  • Position: #365 / 1076
  • Number of attempts: 1
Number an outline - 280 entries

The indent and words are right, but the numbers are all wrong.

  • Best score: 25
  • Best player score: 34
  • Position: #22 / 78
  • Number of attempts: 3
Pairs of numbers - 362 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 28
  • Position: #37 / 135
  • Number of attempts: 11
Sort by sum of numbers in a line(?) - 67 entries

The lines with the biggest sums need to be at the top. The sums are on the right, which makes life hard. Maybe you can find a feature that will do all the work for you...

  • Best score: 15
  • Best player score: 16
  • Position: #37 / 39
  • Number of attempts: 2
Tiny column alignment - 61 entries

Align using the four blocks, don't forget to lowercase and have fun!

  • Best score: 33
  • Best player score: 33
  • Position: #6 / 23
  • Number of attempts: 4
Multiplication table. - 232 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 31
  • Position: #5 / 68
  • Number of attempts: 20
Sort the cardinal numbers - 310 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 12
  • Position: #58 / 148
  • Number of attempts: 1
Line Zipper - 472 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 13
  • Position: #66 / 214
  • Number of attempts: 1
Berel94
Github:

entered into 59 challenges

contributed 0 challenges