Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Leaderboard, Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d22038df74d0b11490000fb

Return the cow

This cow is too verbose. Give it a lesson.

Start file
 ________________________________________
/ If you learn one useless thing every   \
| day, in a single year you'll learn 365 |
| useless things.                        |
\                   -- fortune | cowsay  /
 ----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
End file
 ________________________________________
/ If you learn one useless thing every   \
| day, in a single year you'll learn 365 |
| useless things.                        |
\                   -- fortune | cowsay  /
 ----------------------------------------
                    ^__^   /        
            _______/(oo)  /         
        /\/(       /(__)            
           | w----||                
           ||     ||

View Diff

7,11c7,11
<         \   ^__^
<          \  (oo)\_______
<             (__)\       )\/\
<                 ||----w |
<                 ||     ||
---
>                     ^__^   /        
>             _______/(oo)  /         
>         /\/(       /(__)            
>            | w----||                
>            ||     ||

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 24 remaining solutions by signing in and submitting your own entry
#25 Renat Aksitov / @Korvin79 - Score: 70 - 03/04/12 @ 04:06
:se ri et<NL>7GcG<C-R>"<Esc>geld<fd-58>3I <Esc>-.2-4.-12.f\*l<C-V>jr(%r(E<C-V>kr)Nr/N.n.n.W.N.hr\ZZ

0 comments

#26 Francisco Dibar / @frandibar - Score: 77 - 01/10/11 @ 18:27
:7,$!rev<CR>/\/<CR>r\/\\<CR>r/n.nnn.n.n.n./)<CR>r(n.n./(<CR>r)3n.7G<C-V>L11I <Esc>9i <Esc>ji <Esc>j3xL$T|DZZ

0 comments

#27 aimee / @sermoa - Score: 80 - 01/03/11 @ 10:07
:7,11!rev<CR>20I <Esc>j12I <Esc>j8I <Esc>j11I <Esc>j.:7,9s/\\/\//g<CR>lr\:7,9s/(/)<CR>:8,9s/)/(<CR>f)r(jjDZZ

@sermoa: Okay, so it's not as simple as reversing lines 7-11 as i first thought! I have to insert some spaces, then i have to switch backstrokes to forwardstrokes, and change open brackets to close brackets and vice versa. Finally i have to remove a bit of whitespace so that it matches the expected result.

@sermoa: I much prefer @derp's :tr to transpose characters. Much more efficient than my :s commands.

@henrik: :7,$ is a little shorter - $ means the last line. You could avoid having to escape the / by using % as separators instead, e.g. s%\\%/%g

@sermoa: Oh, so THAT'S why people use different characters. I had wondered! thanks! :)

4 comments

#28 drio / @drio - Score: 85 - 01/16/11 @ 08:53
:7,$!rev<CR>20I <Esc>j12I <Esc>j8I <Esc>jj11<Esc>k11I <Esc>j.<Esc>:7,9s/\\/\//g<CR>lr\:7,9s/(/)<CR>:8,9s/)/(<CR>f)r(jjDZZ

0 comments

#29 Mohammad-Javad Izadi / @mjizadi - Score: 87 - 01/05/11 @ 06:55
G11A <Esc>k.k8A <Esc>k12A <Esc>k20A <Esc>VG!rev<CR>G9 d$:%s/)/x/g<CR>:%s/(/)/g<CR>:%s/x/(/g<CR>R/\/<Esc>f\r/k.f\r/kl.ZZ

0 comments

#30 Pete Johns / @johnsyweb - Score: 99 - 01/10/11 @ 11:47
7Gx9I <Esc>3A <Esc>a/<Esc>+R  /<Esc>df\A<C-R>"<BS>  /<Esc>I <Esc>+d%$pf\F\xh3XF\s/\/( <Esc>04x+5XlR w<Esc>fwR-|<Esc>+5X:se ve=all<CR>-$16l<C-V>3kr ZZ

0 comments

#31 無ん垢の叫び / @john_ababa - Score: 181 - 02/24/12 @ 02:18
6jdG:a!<CR>                    ^__^   /        <CR>            _______/(oo)  /         <CR>        /\/(       /(__)            <CR>           | w----||                <CR>           ||     ||<CR><Esc><Esc>ZZ

0 comments

Created by: @ornicar

31 active golfers, 76 entries

Leaderboard (lowest score wins):
Default_profile_6_normal
41
#1 - derp derp / @derp__

01/03/2011 at 12:22PM

Me-small_normal
41
#2 - Wei Dai / @clvv42

01/06/2011 at 07:29PM

Gintoki_normal
41
#3 - You-Siang Lin / @yslinnctu

12/03/2011 at 06:56PM

Dom-50_normal
42
#4 - dominique pellé / @vimgolfisto

01/03/2011 at 11:58AM

Default_profile_5_normal
45
#5 - alex scott / @4l3xsc0tt

02/01/2011 at 12:21PM

Default_profile_5_normal
51
#6 - Gael / @darkael2

01/05/2011 at 03:59PM

Jlove201003sq_normal
51
#7 - Justin Love / @wondible

08/14/2011 at 11:54AM

Q6hrg93p4r3hn56thmd0_normal
52
#8 - Urtica dioica / @udioica

07/23/2012 at 02:40PM

40051_789281885907_29616532_44170636_2091417_n_normal
52
#9 - Conner McDaniel / @connermcd

11/29/2012 at 09:35AM

5269629558_4998c0a4a9_normal
55
#10 - Aaron Jensen / @aaronjensen

03/18/2011 at 11:46PM

4654945923_eb2c60ee5f_normal
56
#11 - Kerson Hsiao / @KersonHsiao

07/23/2012 at 12:26AM

Untitled_2_normal
57
#12 -  Ikhsan Maulana / @ixandidu

01/07/2011 at 07:33PM

P1000007_normal
57
#13 - h_east (DDD ready) / @h_east

02/05/2011 at 07:06AM

Avatar-small_normal
57
#14 - Hu Junfeng / @hujunfeng

07/27/2011 at 03:43AM

2_normal
58
#15 - Henrik Nyh / @henrik

01/03/2011 at 11:08AM

E55df1cc7d5fdb4ae9bc2afcb9afe7e4_normal
58
#16 - matthewd / @_matthewd

01/03/2011 at 07:38PM

Gravatar_normal
58
#17 - Stephen Morrow / @yawmark

01/26/2011 at 07:20PM

Profile_normal
59
#18 - teepark / @teepark

12/08/2011 at 04:32PM

Default_profile_5_normal
60
#19 - Karel Vervaeke / @karel1980

01/05/2011 at 12:53AM

122_normal
62
#20 - not so punk :] / @notsopunk

06/19/2011 at 06:23AM

Hrleft_normal
64
#21 - Glenn / @spamcow_moo

01/03/2011 at 03:18PM

Default_profile_4_normal
65
#22 - Aurélien Delahaye / @alkove

01/04/2011 at 02:25PM

Default_profile_0_normal
68
#23 - vimja / @vimja666

11/02/2011 at 05:35PM

T_e_normal
69
#24 - Tim Chase / @gumnos

01/03/2011 at 01:20PM

Default_profile_2_normal
70
#25 - Renat Aksitov / @Korvin79

03/04/2012 at 04:06AM

Default_profile_6_normal
77
#26 - Francisco Dibar / @frandibar

01/10/2011 at 06:27PM

45072b62-96bd-47e0-bb3a-83ec72a6e2af_normal
80
#27 - aimee / @sermoa

01/03/2011 at 10:07AM

29ed1f20888463b3b72bd9fed88a79b8_normal
85
#28 - drio / @drio

01/16/2011 at 08:53AM

Final_normal
87
#29 - Mohammad-Javad Izadi / @mjizadi

01/05/2011 at 06:55AM

Image_normal
99
#30 - Pete Johns / @johnsyweb

01/10/2011 at 11:47AM

Bc879469f279ee24b7fbdfad7c2216d9_normal
181
#31 - 無ん垢の叫び / @john_ababa

02/24/2012 at 02:18AM