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

Simple, Practical, and Common - 33929 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: #200 / 7489
  • Number of attempts: 6
V to the i - 4833 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1092 / 1904
  • Number of attempts: 2
Extract argument from function - 2379 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #137 / 760
  • Number of attempts: 3
Just the middle - 11555 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2018 / 4234
  • Number of attempts: 2
Basic renumbering - 5707 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #424 / 1274
  • Number of attempts: 5
Add to end of each line... kinda - 339 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: 14
  • Position: #163 / 176
  • Number of attempts: 1
Vice versa - 7981 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #677 / 2147
  • Number of attempts: 9
Vim's not included features - 250 entries

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

  • Best score: 23
  • Best player score: 33
  • Position: #45 / 67
  • Number of attempts: 1
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 10
  • Position: #100 / 269
  • Number of attempts: 3
Swap assigned value - 671 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #152 / 259
  • Number of attempts: 3
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Position: #41 / 281
  • Number of attempts: 5
I forgot quotes - 16127 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1261 / 4208
  • Number of attempts: 4
-a-b-c- - 3225 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #127 / 1140
  • Number of attempts: 4
Don't know what this is - 2025 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: #51 / 587
  • Number of attempts: 5
Where should I put the Newline? - 885 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #365 / 439
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10720 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #843 / 3703
  • Number of attempts: 3
quotes inside quotes - 3185 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: #211 / 1086
  • Number of attempts: 9
Words in parens - 13005 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1972 / 3979
  • Number of attempts: 4
Pairs of numbers - 364 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: 36
  • Position: #68 / 137
  • Number of attempts: 1
Parsing with CSV: Unify lines and result. - 179 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

  • Best score: 21
  • Best player score: 23
  • Position: #51 / 77
  • Number of attempts: 1
abcd > a b c d - 299 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 23
  • Position: #227 / 228
  • Number of attempts: 1
The name of the game - 678 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #136 / 363
  • Number of attempts: 3
Vertical Limit - 2610 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #340 / 771
  • Number of attempts: 3
Switch function arguments - 2188 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #387 / 676
  • Number of attempts: 1
Append semicolon after expressions - 1061 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #55 / 421
  • Number of attempts: 3
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 21
  • Position: #186 / 199
  • Number of attempts: 2
Remove semicolons after expressions - 669 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 12
  • Position: #259 / 265
  • Number of attempts: 1
switch variable - 5101 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #201 / 1756
  • Number of attempts: 6
The meaning - 577 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #204 / 364
  • Number of attempts: 2
imports alignment (python) - 704 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 20
  • Position: #90 / 200
  • Number of attempts: 2
Numbering a List - 1941 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #394 / 657
  • Number of attempts: 2
Assignment Alignment - 897 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 34
  • Position: #196 / 223
  • Number of attempts: 1
A Simple One - 1070 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #347 / 673
  • Number of attempts: 2
Reverse Simple Deletion - 862 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #280 / 463
  • Number of attempts: 2
Reverse characters in a line - 806 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: #160 / 271
  • Number of attempts: 1
Change the content of a string - 1750 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 24
  • Position: #372 / 639
  • Number of attempts: 2
NuM
Twitter:

entered into 36 challenges

contributed 0 challenges