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

Paste a column after a column - 2324 entries

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

  • Best score: 14
  • Best player score: 16
  • Position: #140 / 502
  • Number of attempts: 12
2 quick changes and a numbered list - 610 entries

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

  • Best score: 37
  • Best player score: 46
  • Position: #81 / 146
  • Number of attempts: 3
delete swap - 1578 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #160 / 495
  • Number of attempts: 4
Generate a very basic Python constructor (fixed) - 1197 entries

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

  • Best score: 29
  • Best player score: 37
  • Position: #86 / 252
  • Number of attempts: 7
Visual block training - 1028 entries

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

  • Best score: 17
  • Best player score: 30
  • Position: #86 / 191
  • Number of attempts: 8
Put a newline after every 10 lines in vim - 1600 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 11
  • Position: #149 / 534
  • Number of attempts: 3
hello-world-vimgolf - 2402 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #168 / 681
  • Number of attempts: 3
Fill in the chess board - 917 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 27
  • Position: #64 / 178
  • Number of attempts: 4
Plotting some variables in python - 1597 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 35
  • Position: #75 / 342
  • Number of attempts: 4
Lowercase first characters - 480 entries

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

  • Best score: 33
  • Best player score: 47
  • Position: #140 / 178
  • Number of attempts: 1
Migrated to Postgres! - 321 entries

Celebration completion of this project. https://github.com/igrigorik/vimgolf/pull/322

  • Best score: 24
  • Best player score: 29
  • Position: #59 / 124
  • Number of attempts: 3
simple replacements - 1690 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 23
  • Position: #198 / 375
  • Number of attempts: 5
Inverting Lines - 1858 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #253 / 502
  • Number of attempts: 5
Making 3 line function a one liner. - 311 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #25 / 199
  • Number of attempts: 1
Modernise code - 1350 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 52
  • Position: #231 / 311
  • Number of attempts: 3
Enumerate Bullets - 308 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

  • Best score: 20
  • Best player score: 56
  • Position: #72 / 83
  • Number of attempts: 2
swap number pairs - 2021 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 23
  • Position: #170 / 372
  • Number of attempts: 7
HS Final exam vimgolf - 885 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 28
  • Position: #136 / 232
  • Number of attempts: 3
Rural Post - 4405 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 10
  • Position: #434 / 1082
  • Number of attempts: 6
Satisfy the go linter - 2350 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 26
  • Position: #290 / 462
  • Number of attempts: 4
Add quotes to ansible playbook - 939 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 9
  • Position: #174 / 299
  • Number of attempts: 6
Multiline to Single Line - 679 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #201 / 297
  • Number of attempts: 1
Replace pattern with 1, 2, 3, ... on each line - 1112 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

  • Best score: 21
  • Best player score: 30
  • Position: #146 / 227
  • Number of attempts: 13
Hogwarts Email Sorting - 890 entries

Given a list of emails, get the students full name and their associated house.

  • Best score: 20
  • Best player score: 24
  • Position: #194 / 256
  • Number of attempts: 3
Get mail address from outlook format - 641 entries

Create a mail list space separated of mail list formatted by outlook

  • Best score: 15
  • Best player score: 19
  • Position: #148 / 201
  • Number of attempts: 3
prepend * to every non-blank line - 6248 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 11
  • Position: #732 / 1526
  • Number of attempts: 8
Quote modules - 1063 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 28
  • Position: #194 / 277
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 190 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 7
  • Position: #90 / 100
  • Number of attempts: 2
Add string initializers to an enum - 862 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 22
  • Position: #97 / 254
  • Number of attempts: 4
Copy three lines - 2863 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 17
  • Position: #296 / 637
  • Number of attempts: 5
That hyphen - 2560 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 10
  • Position: #277 / 696
  • Number of attempts: 3
Just the middle - 11367 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3171 / 4166
  • Number of attempts: 3
Make HTML List - 1042 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 49
  • Position: #192 / 272
  • Number of attempts: 3
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 63 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

  • Best score: 18
  • Best player score: 18
  • Position: #29 / 37
  • Number of attempts: 2
Basic renumbering - 5591 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #258 / 1258
  • Number of attempts: 1
create arrows in a list - 106 entries

Add arrow at same distance

  • Best score: 10
  • Best player score: 13
  • Position: #68 / 71
  • Number of attempts: 2
Wrap text in quotes - 349 entries

All the blocks of text should be wrapped in quotation marks.

  • Best score: 16
  • Best player score: 17
  • Position: #71 / 120
  • Number of attempts: 4
Sort files from hosts - 179 entries

Resume files by host. I hope you enjoy with this challenge

  • Best score: 15
  • Best player score: 16
  • Position: #32 / 74
  • Number of attempts: 5
From A to B - 564 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 23
  • Position: #137 / 155
  • Number of attempts: 10
Simple format (2) - 334 entries

try again!

  • Best score: 23
  • Best player score: 30
  • Position: #38 / 69
  • Number of attempts: 3
Collect List - 4266 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 17
  • Position: #1008 / 1187
  • Number of attempts: 4
Space out the alphabet - 1629 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 21
  • Position: #293 / 441
  • Number of attempts: 1
Mute the second method of this script - 447 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #145 / 237
  • Number of attempts: 3
Condensed Cases - 788 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: 15
  • Position: #171 / 242
  • Number of attempts: 7
Word frequency alignment - 278 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 5
  • Position: #108 / 159
  • Number of attempts: 6
Stairs Indenting - 448 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 16
  • Position: #161 / 193
  • Number of attempts: 5
Switch function arguments - 2082 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #178 / 652
  • Number of attempts: 5
Append semicolon after expressions - 1015 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #128 / 407
  • Number of attempts: 4
Remove noise from HTTP log - 699 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 16
  • Position: #196 / 271
  • Number of attempts: 8
Line Zipper - 450 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 13
  • Position: #63 / 210
  • Number of attempts: 6
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 19
  • Position: #67 / 194
  • Number of attempts: 15
Generate English Alphabets - 475 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 42
  • Position: #184 / 204
  • Number of attempts: 2
Assignment Alignment - 832 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 30
  • Position: #168 / 215
  • Number of attempts: 6
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #359 / 454
  • Number of attempts: 1
Hatsuyume - 462 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 16
  • Best player score: 17
  • Position: #15 / 176
  • Number of attempts: 1
Make Fancy Header - 1014 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 19
  • Position: #247 / 338
  • Number of attempts: 1
Reverse characters in a line - 724 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 16
  • Position: #154 / 255
  • Number of attempts: 5
._.
Twitter:

NaN

entered into 57 challenges

contributed 0 challenges